menu
Roblox Forum Archive
Home
User Search
Forums
Donate
search
settings
Home
User Search
Forums
Donate
launch
Go to User Dashboard
Forums
Scripters
in pairs isnt working for me
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right
in pairs isnt working for me
201S
Join Date: 2015-11-14
Post Count: 286
#183897675
Thursday, February 18, 2016 8:09 PM GMT
here is part of my script, not the full thing for i,v in pairs(game.Workspace.Building.plates:GetChildren()) do if v == true then v.Anchored = false for some reason im not getting any errors but the parts dont unanchor, how do i fix this?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
KLGA
Join Date: 2014-04-19
Post Count: 2571
#183897782
Thursday, February 18, 2016 8:11 PM GMT
Try removing "if v == true". That's checking if your plates have a value of 'true'. Instead you should add something like "if v:IsA("BasePart")"
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
201S
Join Date: 2015-11-14
Post Count: 286
#183897986
Thursday, February 18, 2016 8:15 PM GMT
i tried doing the :IsA(), but it still wont work :(
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
indeimaus
Join Date: 2014-09-01
Post Count: 4285
#183898109
Thursday, February 18, 2016 8:18 PM GMT
you don't need true because it's checking if v exists already
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
201S
Join Date: 2015-11-14
Post Count: 286
#183898474
Thursday, February 18, 2016 8:26 PM GMT
if i dont keep the "if v == true" or something similar in, for some reason the script just doesnt work
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
indeimaus
Join Date: 2014-09-01
Post Count: 4285
#183898585
Thursday, February 18, 2016 8:28 PM GMT
What I mean is that all you need to say is "if v then" because lua will assume you mean you're asking if it exists.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
cofunction
Join Date: 2012-12-11
Post Count: 3357
#183898713
Thursday, February 18, 2016 8:31 PM GMT
Are you sure "plates" has any children?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
powerhotmail123
Join Date: 2011-04-11
Post Count: 5041
#183899895
Thursday, February 18, 2016 8:55 PM GMT
Put a print statement outside the if statement, see if that prints. Enjoying your stay at the Scripters Forum? Join this!
http://www.roblox.com/My/Groups.aspx?gid=2582784
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right