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: Respawn event not working

Previous Thread :: Next Thread 
Zkiller11 is not online. 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
Mikenberg123 is not online. Mikenberg123
Joined: 18 Jan 2011
Total Posts: 2099
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 is not online. 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 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
07 Jun 2013 08:29 PM
Bump
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
07 Jun 2013 08:57 PM
Bump.
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
07 Jun 2013 09:16 PM
Bump..
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
07 Jun 2013 09:37 PM
Bump...
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
07 Jun 2013 10:06 PM
Bump....
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
08 Jun 2013 10:58 AM
Anyone out there? .-.
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
08 Jun 2013 12:15 PM
.....
Report Abuse
monster07 is not online. 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
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
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 is not online. 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
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
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 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
08 Jun 2013 06:48 PM
What

Is there a work around for this?
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
08 Jun 2013 06:48 PM
replace print("checker1") with

Instance.new("Message", Workspace).Text = "Checker1"

and play online
Report Abuse
Zkiller11 is not online. 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 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
08 Jun 2013 11:57 PM
Bump
Report Abuse
Frostglacier is not online. Frostglacier
Joined: 28 Oct 2010
Total Posts: 4177
09 Jun 2013 12:02 AM
Try separating the PlayerAdded events instead of having one under the other.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
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