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 » Scripters
Home Search
 

Re: How should i call this function? URGENT D:

Previous Thread :: Next Thread 
frriend is not online. 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 is not online. 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 is not online. 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 is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
06 Apr 2015 12:17 AM
Trey why wont you help me?
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
06 Apr 2015 12:26 AM
Bump please i really really need help D:
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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