|
| 18 Jun 2012 11:38 AM |
The last two reset scripts that people helped me with never worked, so I need to get this to work this time.
function onEntered(Player) player.Character.Humanoid.Health = 0 if (player) ~= nil then end end
Lombardo helped me with this script, but it is still not working. >.<
Any suggestions? |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 11:39 AM |
| This script is supposed to make the person reset when they enter the server, once. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 11:43 AM |
| For one thing, you capitalized Player in the function but not in the body of the script... The script would see "Player" and "player" as two different variables. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 11:46 AM |
| Typo, sorry, but overall, even with all the player's being typed as "Player" it still wouldn't work. |
|
|
| Report Abuse |
|
|
cj10127
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 1818 |
|
|
| 18 Jun 2012 11:47 AM |
game.Players.PlayerAdded:connect(function(newPlayer) repeat wait() until newPlayer.Character~=nil newPlayer.Character:BreakJoints() end)
You had forgotten the connection line. Along with this, you capitalised player in the function yet not in the main script.
❈RAT: Director of Intra-Clan Affairs/Great Vilicus Admiral❈ |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 18 Jun 2012 11:49 AM |
"repeat wait() until newPlayer.Character~=nil"
Why not: newPlayer.CharacterAdded:wait()
? |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 11:49 AM |
| Thank you cj, the RAT Admiral. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 11:58 AM |
Updated Script> Tools>Test> Play Solo> I didn't die. >.<
The whole point of this is so I can reset when I enter my place and spawn at a [FOR] Team SpawnLocation. Should I just add this into my switch team script?
FOR = 582465
Hostile = 00000
local function onPlayerEntered(newPlayer) if newPlayer:IsInGroup(FOR) then newPlayer.TeamColor = game.Teams:FindFirstChild("Fighters Of Roblox").TeamColor
elseif newPlayer:IsInGroup(7013) then -- Other account is in RAT, bluh.
newPlayer.TeamColor = game.Teams:FindFirstChild("Allies").TeamColor elseif newPlayer:IsInGroup(Hostile) then
newPlayer.TeamColor = game.Teams:FindFirstChild("Raiders").TeamColor else newPlayer.TeamColor = game.Teams:FindFirstChild("Neutral").TeamColor end end
game.Players.ChildAdded:connect(onPlayerEntered)
|
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 18 Jun 2012 12:04 PM |
FOR = 582465 Hostile = 00000 T = game.Teams
game.Players.PlayerAdded:connect(function(plyr) plyr.CharacterAdded:wait() if plyr:IsInGroup(FOR) then plyr.TeamColor = T['Fighters Of Roblox'].TeamColor elseif plyr:IsInGroup(7013) then plyr.TeamColor = T['Allies'].TeamColor elseif plyr:IsInGroup(Hostile) then plyr.TeamColor = T['Raiders'].TeamColor else plyr.TeamColor = T['Neutral'].TeamColor end plyr.Character:BreakJoints() end)
Maybe? |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 12:07 PM |
| I will see what I can do, thanks. Again. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 12:11 PM |
| Nope. That just broke it entirely. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 18 Jun 2012 12:15 PM |
| Did you edit anything? Or are you getting any output? |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 12:21 PM |
| Lets see what happens when I add the respawn part of your version to mine. |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 18 Jun 2012 12:34 PM |
Okay, this should work? function onPlayerEntered(player) if player:IsInGroup(whateverthegroupidis) then player:BreakJoints() player.TeamColor = BrickColor.new("whatevatheteamcolais") else player:BreakJoints() end end
game.Players.PlayerAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 01:16 PM |
>.< In all ways, the original assign team script was the best. I just need a reset script that works. >.< Help is still needed.
function onEntered(newplayer) newplayer.Character.Humanoid.Health = 0 if newplayer ~= nil then end end
Would this work? |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 01:20 PM |
Quick correction,
game.Players.PlayerAdded:connect(onEntered) |
|
|
| Report Abuse |
|
|
ExoCross
|
  |
| Joined: 26 Jan 2011 |
| Total Posts: 179 |
|
|
| 18 Jun 2012 01:23 PM |
Game.Players.PlayerAdded:connect(function(newplayer) newplayer.CharacterAdded:wait() newplayer.Character:BreakJoints() end)
|
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 01:30 PM |
| I never knew a simple reset script could be so confusing. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 01:37 PM |
| Output isn't giving me anything either. Bluh. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 01:43 PM |
wait(1) game.Player.PlayerAdded:connect(function(Player) Player.CharacterAdded:wait() if Player.Character:findFirstChild("Humanoid") then Player.Character:BreakJoints() end end)
Worked for me.
--TehChikenHater ლ(ಠ_ಠლ) |
|
|
| Report Abuse |
|
|