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 » Scripting Helpers
Home Search
 

Re: SpawnLocation

Previous Thread :: Next Thread 
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
22 Jul 2011 01:45 PM
Let's say we have SpawnLocations A, B, C, all of same Team color.

When Player dies, I want him to go to Spawn A.
When needed, I want to change and make it C.
How?
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
22 Jul 2011 01:46 PM
Make a sript that moves him to the proper spawn when he respawns?
Report Abuse
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
22 Jul 2011 01:48 PM
Duh. But how?
Report Abuse
Ronnie124 is not online. Ronnie124
Joined: 26 Nov 2009
Total Posts: 694
22 Jul 2011 01:48 PM
Spawns = {"A","B","C"}

Player.CharacterAdded:connect(function(Char)
Spawn = [math.random(1,#Spawns)]
Char:MoveTo(Workspace[Spawn].Position)
end)
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
22 Jul 2011 01:51 PM
There are major problems with that, Ronnie.
Report Abuse
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
22 Jul 2011 01:53 PM
Yeah, Workspace isn't a table.
Report Abuse
Ronnie124 is not online. Ronnie124
Joined: 26 Nov 2009
Total Posts: 694
22 Jul 2011 01:53 PM
Oh really, tell me what's wrong with it.
Report Abuse
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
22 Jul 2011 01:54 PM
I mean Spawn = error/a number.
Report Abuse
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
22 Jul 2011 01:55 PM
Spawns = {"A","B","C"}
Spawn = [math.random(1,#Spawns)]

print(Spawn)

>Gives an error
Report Abuse
Ronnie124 is not online. Ronnie124
Joined: 26 Nov 2009
Total Posts: 694
22 Jul 2011 01:58 PM
You used to be able to do that before the update.
Report Abuse
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
22 Jul 2011 02:02 PM
Spawns = {"A","B","C"}

Player.CharacterAdded:connect(function(Char)
Spawn = Spawns[math.random(1,#Spawns)]
Char:MoveTo(Workspace[Spawn].Position)
end)


This was the one:
Spawn = Spawns[math.random(1,#Spawns)]

Now I'll just test it...
Report Abuse
RawrBot is not online. RawrBot
Joined: 22 Aug 2008
Total Posts: 832
22 Jul 2011 02:06 PM
The MoveTo method works. Thanks Ron
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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