redlo43
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 4722 |
|
|
| 10 Nov 2013 12:42 PM |
It doesn't do anything no output I'm trying to debug it
game.Players.PlayerAdded:connect(function(player)--Playeradded player.CharacterAdded:connect(function(character)--Player who got added is respawned Plyr = player if _G.game then--global variable throughout whole game if game.Workspace.map1 then --gamemodes local ran = math.random(1,5) if ran == 1 then Plyr.Character.Torso.CFrame = CFrame.new(-89.809, 2.2, -325.854) elseif ran == 2 then Plyr.Character.Torso.CFrame = CFrame.new(-142, 16.4, -218) elseif ran == 3 then Plyr.Character.Torso.CFrame = CFrame.new(-240.146, 27.2, -322.146) elseif ran == 4 then Plyr.Character.Torso.CFrame = CFrame.new(-252, 77.6, -21) else Plyr.Character.Torso.CFrame = CFrame.new(2, 3.2, 7) end elseif game.Workspace.map2 then local ran = math.random(1,4) if ran == 1 then Plyr.Character.Torso.CFrame = CFrame.new(49, 27.8, 41) elseif ran == 2 then Plyr.Character.Torso.CFrame = CFrame.new(-245, 32.6, 34) elseif ran == 3 then Plyr.Character.Torso.CFrame = CFrame.new(13, 7, -218) elseif ran == 4 then Plyr.Character.Torso.CFrame = CFrame.new(-37.868, 57, -247.632) end end else print 'game is not running!' end end) end) |
|
|
| Report Abuse |
|
|
redlo43
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 4722 |
|
|
| 10 Nov 2013 12:45 PM |
I think it might be the player added part but how else am I supposed to get players? |
|
|
| Report Abuse |
|
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 10 Nov 2013 12:46 PM |
| If you're trying to do this in Play Solo, you're going to have issues - The player will be loaded before the script runs. |
|
|
| Report Abuse |
|
|
redlo43
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 4722 |
|
| |
|
redlo43
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 4722 |
|
|
| 10 Nov 2013 12:53 PM |
| still doesn't work in play mode |
|
|
| Report Abuse |
|
|
redlo43
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 4722 |
|
|
| 10 Nov 2013 12:53 PM |
I spawn on a spawn in the lobby, but I don't teleport to one of the desired positions
I just stay in the lobby the whole time
|
|
|
| Report Abuse |
|
|
redlo43
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 4722 |
|
| |
|
redlo43
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 4722 |
|
| |
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 10 Nov 2013 01:08 PM |
1) You shouldn't have your global variable named 'game' or 'Game', seeing as that's already used by ROBLOX
2) Why do you have 'Plyr = player'? You're just making that variable global and causing issues later on. Delete that line and replace all your 'Plyr's with 'player', or just change the argument to 'Plyr'
3) 'if game.Workspace.map1 then' makes no sense. I think what you mean is this: if Workspace:FindFirstChild("map1") then |
|
|
| Report Abuse |
|
|