Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 07 Jun 2013 04:57 PM |
This doesn't even print "Respawn" when a player is added... Why doesn't this work? I don't get output.
deb = false game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if deb == false then deb = true if player.TeamColor == BrickColor.new "Bright green" then player.Character.Torso.CFrame = CFrame.new(-147, 1.8, 100) --Positon Math.Random script.Parent:Remove() elseif player.TeamColor == BrickColor.new "Bright blue" then player.Character.Torso.CFrame = CFrame.new(-139, 1.8, 110) script.Parent:Remove() print("Respawn") deb = false end end end) end)
I want it to detect what the player's TeamColor is when they respawn and then move them to the corresponding position, according to their TeamColor.. But it doesn't do anything... What am I doing wrong here? |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 05:27 PM |
player.TeamColor == BrickColor.new("Bright green")
-- You need to use the brackets, try, it might just work. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 07 Jun 2013 07:36 PM |
deb = false game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if deb == false then deb = true if player.TeamColor == BrickColor.new ("Bright green") then player.Character.Torso.CFrame = CFrame.new(-147, 1.8, 100) script.Parent:Remove() elseif player.TeamColor == BrickColor.new ("Bright blue") then player.Character.Torso.CFrame = CFrame.new(-139, 1.8, 110) script.Parent:Remove() print("Respawn") deb = false end end end) end)
Nope, that didn't do it.. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
monster07
|
  |
| Joined: 19 Jul 2009 |
| Total Posts: 533 |
|
|
| 08 Jun 2013 12:16 PM |
He told you. Use brackets. HE EVEN GAVE YOU A SCRIPT.
499th post |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2013 12:17 PM |
put
print("checker1") after playeradded event
print("checker2") after characteradded event
and let me know what the output is. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 08 Jun 2013 06:33 PM |
"He told you. Use brackets. HE EVEN GAVE YOU A SCRIPT."
Lol? I think he meant parentheses, which I put in my script. Read my re-posts next time before going on a rant.
"put
print("checker1") after playeradded event
print("checker2") after characteradded event
and let me know what the output is. "
It didn't print anything.
Current script:
deb = false game.Players.PlayerAdded:connect(function(player) print("Checker1") player.CharacterAdded:connect(function(character) print("Checker2") if deb == false then deb = true if player.TeamColor == BrickColor.new ("Bright green") then player.Character.Torso.CFrame = CFrame.new(-147, 1.8, 100) script.Parent:Remove() elseif player.TeamColor == BrickColor.new ("Bright blue") then player.Character.Torso.CFrame = CFrame.new(-139, 1.8, 110) script.Parent:Remove() print("Respawn") deb = false end end end) end) |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2013 06:34 PM |
PlayerAdded doesn't work in Play Solo anymore.
It only works in online, but you can't see 'print' in online so ya. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 08 Jun 2013 06:48 PM |
What
Is there a work around for this? |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2013 06:48 PM |
replace print("checker1") with
Instance.new("Message", Workspace).Text = "Checker1"
and play online |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 08 Jun 2013 07:23 PM |
Nothing..
Current code:
c1 = Instance.new("Message", Workspace) c2 = Instance.new("Message", Workspace) deb = false game.Players.PlayerAdded:connect(function(player) c1.Text = "Checker1" wait(2) c1:Remove() player.CharacterAdded:connect(function(character) c2.Text = "Checker2" wait(2) c2:Remove() if deb == false then deb = true if player.TeamColor == BrickColor.new ("Bright green") then player.Character.Torso.CFrame = CFrame.new(-147, 1.8, 100) script.Parent:Remove() elseif player.TeamColor == BrickColor.new ("Bright blue") then player.Character.Torso.CFrame = CFrame.new(-139, 1.8, 110) script.Parent:Remove() print("Respawn") deb = false end end end) end) |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
|
| 09 Jun 2013 12:02 AM |
| Try separating the PlayerAdded events instead of having one under the other. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2013 12:04 AM |
This is running once. No need for debounce. Also, you put spaces after BrickColor.new.
c1 = Instance.new("Message", Workspace) c2 = Instance.new("Message", Workspace) game.Players.PlayerAdded:connect(function(player) c1.Text = "Checker1" wait(2) c1:Remove() player.CharacterAdded:connect(function(character) c2.Text = "Checker2" wait(2) c2:Remove() if player.TeamColor == BrickColor.new("Bright green") then --You put a space. player.Character.Torso.CFrame = CFrame.new(-147, 1.8, 100) script.Parent:Remove() elseif player.TeamColor == BrickColor.new("Bright blue") then --And here too. player.Character.Torso.CFrame = CFrame.new(-139, 1.8, 110) script.Parent:Remove() print("Respawn") end end) end) |
|
|
| Report Abuse |
|
|