Yea it's pretty simple, if you know how to try and teleport a player to a certain spawn then you should know about Vector3.new
and CFrames
or else your just stealing someones script and you don't deserve help.
Anyway if you don't know about CFrames
or Vector3.new
then visit these sites;
http://wiki.roblox.com/index.php?title=API:Vector3
http://wiki.roblox.com/index.php?title=CFrame
http://wiki.roblox.com/index.php?title=Position
Anyway once your done with those then first you want to add a StringValue to the player.
I'm only helping here;
This should be a Normal Script Inside ServerScriptService
01 | game.Players.PlayerAdded:Connect( function (plr) |
03 | local SF = Instance.new( 'Folder' ) |
04 | SF.Name = 'SpawnFolder' |
07 | local CS = Instance.new( 'StringValue' ) |
08 | CS.Name = 'CurrentSpawn' |
Now you got the variables. Inside every part add a script with a .Touched function and give it a name
Example;
A SCRIPT INSIDE A PART, MAKE SURE YOU NAME EACH SPAWN DIFFERENTLY
1 | local Part = script.Parent |
3 | Part.Touched:Connect( function (p) |
4 | local plr = game.Players:GetPlayerFromCharacter(p.Parent) |
5 | plr:WaitForChild( 'SpawnFolder' ).CurrentSpawn.Value = Part.Name |
There after add a script saying this;
If player's humanoids health reaches 0 then teleport player to the touched part's name. Also only add the touch script to spawns that you want. And change the name to different names so they don't spawn in wrong place.
If helped plz Accept Answer
Good luck and have fun developing.