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: Is there a script that will reset a player onTeamChange?

Previous Thread :: Next Thread 
yan3321 is not online. yan3321
Joined: 13 Sep 2008
Total Posts: 2107
15 Jan 2014 07:08 AM
Title.
Report Abuse
ForceSky is not online. ForceSky
Joined: 30 Jul 2012
Total Posts: 2379
15 Jan 2014 07:09 AM
Player.Changed

Check if the team is changed, then destroy the character.
Report Abuse
yan3321 is not online. yan3321
Joined: 13 Sep 2008
Total Posts: 2107
15 Jan 2014 07:17 AM
Mind posting out the full script?
I'm fairly new to scripting, so yeah.
Sorry for being a greedy kid.
Report Abuse
ForceSky is not online. ForceSky
Joined: 30 Jul 2012
Total Posts: 2379
15 Jan 2014 07:28 AM
No problem.

game.Players.PlayerAdded:connect(function(plr)
plr.Changed:connect(function(prop)
if prop == plr.TeamColor then
plr.Character:BreakJoints()
end
end)
end)

I think that's about right, not so sure about line 3 though.
Report Abuse
yan3321 is not online. yan3321
Joined: 13 Sep 2008
Total Posts: 2107
15 Jan 2014 08:00 AM
Thanks, ForceSky, but it, sadly, didn't work. Any more ideas?
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
15 Jan 2014 08:08 AM
i have an idea hold on
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
15 Jan 2014 08:16 AM
put this inside a LocalScript (this LocalScript parent must be StarterGui)

plr = game.Players.LocalPlayer

function onChanged(property)
if property == "TeamColor" then
plr.Character.Humanoid.Health = nil
end

plr.Changed:connect(onChanged)
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
15 Jan 2014 08:24 AM
you know what really grinds my gear? when you help someone and they wont update you if it worked or not...
Report Abuse
NiceCoder is not online. NiceCoder
Joined: 15 Oct 2012
Total Posts: 6593
15 Jan 2014 09:18 AM
^
Report Abuse
yan3321 is not online. yan3321
Joined: 13 Sep 2008
Total Posts: 2107
15 Jan 2014 07:19 PM
Sorry, I live in a different timezone, so when it's night for the US, it's early morning for me. It's 9.10 am here, and I'm going to test it. Just need to wait for a player to come.
Report Abuse
yan3321 is not online. yan3321
Joined: 13 Sep 2008
Total Posts: 2107
15 Jan 2014 07:48 PM
Still not working.
I did put it in StarterGui.
Hmm.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
15 Jan 2014 07:51 PM
--Global script, Workspace
game.Players.PlayerAdded:connect(function(player)
player.Changed:connect(function(prop)
if prop == "TeamColor" then
player:LoadCharacter()
end
end)
end)
--

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
yan3321 is not online. yan3321
Joined: 13 Sep 2008
Total Posts: 2107
15 Jan 2014 08:28 PM
@above
It worked!
Thanks for all your help, guys!
It's really much appreciated.
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