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: Help With Player, Respawn Codes

Previous Thread :: Next Thread 
Jro1311 is not online. Jro1311
Joined: 01 Jun 2013
Total Posts: 3328
25 Jul 2013 06:32 AM
I made a thread before on this subject but nobody got it right so I'm just going to give out all the codes so that you can figure out how to make players respawn at the end of each round.

while true do
a = Instance.new("Hint") -- This inserts a Text Bar..
a.Parent = game.Workspace -- In Workspace
a.Text = "Choosing Map 'Urban' " -- The Text in the bar
wait(1) -- wait 1 second
a.Text = "Choosing Map 'Lava' "
wait(1)
a.Text = "Choosing Map 'Park' "
wait(1)
a.Text = "Choosing Map"
wait(3)

lol = (math.random(1,5)) -- it will chose a number between 1-5
if lol == 1 then -- If it chose 1 then
b = Instance.new("Message") -- Make a message
b.Parent = game.Workspace -- In Workspace
b.Text = " Urban Map Chosen!" -- Message text..
a.Text = "Loading Map 'Urban' " -- Hint Text
wait(2) -- wait 2 seconds.
map = game.Lighting.Map1:Clone() -- Okay so in your lighting thingy in explorer put in a map. Call it "Map1"
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
a.Text = "Begin!"
target = Vector3.new(74.4, 3.9, -42.5) --Ok so put your co-ordinates for where you want your players to go..
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) --add an offset of 5 for each character
end
wait(3)
a:Remove()
b:Remove()
end
if lol == 2 then
b = Instance.new("Message")
b.Parent = game.Workspace
b.Text = " Lava Map Chosen! "
a.Text = "Loading Map 'Lava' "
wait(2)
map = game.Lighting.Map2:Clone() -- Put anouther map in Lighting call it Map2
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
a.Text = "Last Man Standing Wins!"
target = Vector3.new(74.4, 3.9, -42.5) --Ok so put your co-ordinates for where you want your players to go..
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0))
end
wait(3)
a:Remove()
b:Remove()
end
if lol == 3 then
b = Instance.new("Message")
b.Parent = game.Workspace
b.Text = " Park Map Chosen! "
a.Text = "Loading Map 'Park' "
wait(2)
map = game.Lighting.Map3:Clone() -- Make map Map3 and put it in lighting
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
a.Text = "Last Man Standing Wins!"
target = Vector3.new(74.4, 3.9, -42.5) --Ok so put your co-ordinates for where you want your players to go..
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0))
end
wait(3)
a:Remove()
b:Remove()
end
if lol == 4 then
b = Instance.new("Message")
b.Parent = game.Workspace
b.Text = "MAP 4 CHOSEN!"
a.Text = "Loading MAP 4"
wait(2)
map = game.Lighting.Map4:Clone() -- Make Map4 and put it in lighting
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
a.Text = "Last Man Standing Wins!"
target = Vector3.new(74.4, 3.9, -42.5) --Ok so put your co-ordinates for where you want your players to go..
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0))
end
wait(3)
a:Remove()
b:Remove()
end
if lol == 5 then
b = Instance.new("Message")
b.Parent = game.Workspace
b.Text = "MAP 5 CHOSEN!"
a.Text = "Loading MAP 5"
wait(2)
map = game.Lighting.Map5:Clone() -- And Map5
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
a.Text = "Last Man Standing Wins!"
target = Vector3.new(74.4, 3.9, -42.5) --Ok so put your co-ordinates for where you want your players to go..
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0))
end
wait(3)
a:Remove()
b:Remove()
end
wait(10) -- Change this to how long you want your round to be..
c = Instance.new("Message")
c.Parent = game.Workspace
c.Text = "Round Over!" -- END!
wait(3)
c:Remove()
game.Workspace.Map:Remove()
end
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
25 Jul 2013 06:34 AM
You can respawn player by using the LoadCharacter member function of Player
Report Abuse
Jro1311 is not online. Jro1311
Joined: 01 Jun 2013
Total Posts: 3328
25 Jul 2013 06:34 AM
Okay, but I keep trying everything and it's not working... Maybe I'm putting it in the wrong spot maybe?

~The Truth Lies Within My Post~
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
25 Jul 2013 06:35 AM
What did you try?
Report Abuse
Jro1311 is not online. Jro1311
Joined: 01 Jun 2013
Total Posts: 3328
25 Jul 2013 06:37 AM
1.i=game.workspace:GetAllChildren()
if i.Classname = model then
i.Humanoid.Health = 0
end

2.for i,v in pairs(game.Players:GetPlayers())do
v.Character.Humanoid.Health = 0
end

3.wait(0)(game.Players:GetPlayers())do
v.Character.Humanoid.Health = 0
end

~The Truth Lies Within My Post~
Report Abuse
Jro1311 is not online. Jro1311
Joined: 01 Jun 2013
Total Posts: 3328
25 Jul 2013 06:41 AM
Anybody? :l

~The Truth Lies Within My Post~
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
25 Jul 2013 06:42 AM
Your second attempt should have worked, but I can improve it for you:

    for i,v in pairs(game.Players:GetPlayers())do
        v:LoadCharacter()
    end
Report Abuse
Jro1311 is not online. Jro1311
Joined: 01 Jun 2013
Total Posts: 3328
25 Jul 2013 06:47 AM
Where would I put it? I put it at the end but every time nothing happens. Check the script codes below and see where to put it.

~The Truth Lies Within My Post~
Report Abuse
Jro1311 is not online. Jro1311
Joined: 01 Jun 2013
Total Posts: 3328
25 Jul 2013 06:49 AM
I mean above *facedesk*

~The Truth Lies Within My Post~
Report Abuse
Jro1311 is not online. Jro1311
Joined: 01 Jun 2013
Total Posts: 3328
25 Jul 2013 06:52 AM
Help?

~The Truth Lies Within My Post~
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