generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Script only works for first value

Previous Thread :: Next Thread 
Mehssi is not online. Mehssi
Joined: 15 Mar 2015
Total Posts: 599
29 Nov 2015 09:29 PM
blue = workspace.Values.bluePositions
pos = script.Parent
positions = {{blue.First,pos.First},{blue.Second, pos.Second},{blue.Third,pos.Third},{blue.Left,pos.Left},
{blue.Right,pos.Right}}
for i,v in pairs (positions) do
if v.Value ~= "None" then
local play2 = game.Workspace:WaitForChild(v[1].Value)
play2:MoveTo(v[2].Position)
end
end

this will only work for the first bracket (blue.First,pos.First)
can someone tell me why?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
29 Nov 2015 09:31 PM
v.Value is nil, I have no idea why you even put that there.
You're moving it each iteration. You need to clone it if you want it in multiple areas, or yield if you want it to pause before moving.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
29 Nov 2015 09:32 PM
Never mind my second sentence, I was sooooo wrong.


I think that it can't find anything, and is waiting infinitely.
Report Abuse
Mehssi is not online. Mehssi
Joined: 15 Mar 2015
Total Posts: 599
29 Nov 2015 09:38 PM
thanks but it finds the first one perfectly, for some reason it ignores the rest of the values :/
Report Abuse
Mehssi is not online. Mehssi
Joined: 15 Mar 2015
Total Posts: 599
29 Nov 2015 10:58 PM
plz help this is making me rage
Report Abuse
Mehssi is not online. Mehssi
Joined: 15 Mar 2015
Total Posts: 599
29 Nov 2015 11:07 PM
‎(ノಥ益ಥ)ノ ┻━┻
(╯°□°)╯︵ ┻━┻
ლ(ಠ益ಠლ)
(ó ì_í)=ó ò=(ì_í ò)
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
30 Nov 2015 02:44 AM
v.Value
-> Table.Value

I wonder why you're using the if statement.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image