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: Would this work...?

Previous Thread :: Next Thread 
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
20 Jun 2013 01:02 PM
Does this work? I cant test it at the moment.

function HumanoidDied(player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild("WipeOuts")
deaths.Value = deaths.Value + 1
end
end


function playerEntered(newPlayer)

local stats = Instance.new("IntValue")
stats.Name = "leaderstats"

stats.Parent = newPlayer

local deaths = Instance.new("IntValue")
deaths.Name = "WipeOuts"
deaths.Value = 0

deaths.Parent = stats

local humanoid = newPlayer.Character.Humanoid

humanoid.Died:connect(function() HumanoidDied(player) end)
end
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
20 Jun 2013 01:43 PM
^^
Report Abuse
Preston99 is not online. Preston99
Joined: 21 Sep 2008
Total Posts: 247
20 Jun 2013 02:50 PM
You really mutilated the function at the end. Something like:

humanoid.Died:connect(function()
end)


That's used as a function, not a connection.
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
20 Jun 2013 04:58 PM
So...I'm confused
Report Abuse
coolbro935 is not online. coolbro935
Joined: 23 Mar 2013
Total Posts: 233
20 Jun 2013 05:00 PM
function playerEntered(newPlayer)

local stats = Instance.new("IntValue")
stats.Name = "leaderstats"

stats.Parent = newPlayer

local deaths = Instance.new("IntValue")
deaths.Name = "WipeOuts"
deaths.Value = 0

deaths.Parent = stats

local humanoid = newPlayer.Character.Humanoid
end

humanoid.Died:connect(function() HumanoidDied(player)
end)
Report Abuse
Regress is not online. Regress
Joined: 23 Jul 2011
Total Posts: 119
20 Jun 2013 05:01 PM
You created a NEW function instead of CALLING the function that you created above.
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
20 Jun 2013 05:09 PM
So how would I call it?
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