frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 06 Apr 2015 12:13 AM |
Here is my code:
function onHumanoidDied(humanoid, player) local stats = player:findFirstChild("leaderstats") print("Hey") if stats ~= nil then local F = player.IsPlaying if not F then return
else if player.IsPlaying.Value == true then player.IsPlaying.Value = false game.Workspace.IsPlaying.Value = game.Workspace.IsPlaying.Value - 1 end end end end
function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local wins = Instance.new("IntValue") wins.Name = "Wins" wins.Value = 0 wins.Parent = stats
local points = Instance.new("IntValue") points.Name = "Points" points.Value = 0 points.Parent = stats
local IsPlaying = Instance.new("BoolValue") IsPlaying.Name = "IsPlaying" IsPlaying.Value = false IsPlaying.Parent = newPlayer
while true do if newPlayer.Character ~= nil then break end wait(5) end
local humanoid = newPlayer.Character.Humanoid
humanoid.Died:connect(function()onHumanoidDied(humanoid, newPlayer) end)
stats.Parent = newPlayer IsPlaying.Parent = newPlayer
end
game.Players.ChildAdded:connect(onPlayerEntered)
---------------------------------------------------------------------------------------- Now what i need to do is call onHumanoidDied every time a player dies, not just the first time.. because when i die once, it prints back perfect, but then i die again, it doesnt print back.. Is there a way to call that function every time they die? not only the first time?
|
|
|
| Report Abuse |
|
|
TreyCarey
|
  |
| Joined: 05 Jan 2014 |
| Total Posts: 80 |
|
|
| 06 Apr 2015 12:13 AM |
Please refrain from posting more then one thread about the same issue.
~Even a Broken Clock is Right Twice a Day~ |
|
|
| Report Abuse |
|
|
frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 06 Apr 2015 12:14 AM |
| This is slightly different. actually very different, because im posting my question this time. Bump |
|
|
| Report Abuse |
|
|
frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 06 Apr 2015 12:17 AM |
| Trey why wont you help me? |
|
|
| Report Abuse |
|
|
frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 06 Apr 2015 12:26 AM |
| Bump please i really really need help D: |
|
|
| Report Abuse |
|
|