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: how do i make it so that....

Previous Thread :: Next Thread 
LV1Z is not online. LV1Z
Joined: 23 Jul 2011
Total Posts: 652
08 Oct 2012 12:11 PM
function death(humanoid, player)
print(humanoid)
print(player)
local stats = player:FindFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:FindFirstChild("Deaths")
deaths.Value = deaths.Value + 1
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
kills()
end
end

-- Humanoid and player are not nil --

when I call the function, its prints 2 nil's then it says : attempt to call a nill value 'humanoid'
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
08 Oct 2012 12:12 PM
Stop double-posting. And find it before running it.
Report Abuse
LV1Z is not online. LV1Z
Joined: 23 Jul 2011
Total Posts: 652
08 Oct 2012 12:12 PM
?????????
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
08 Oct 2012 12:14 PM
function death(humanoid, player) --[[ you need to define humanoid when the function is activated]]
print(humanoid) -- Not defined right now.
print(player) -- Same
local stats = player:FindFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:FindFirstChild("Deaths")
deaths.Value = deaths.Value + 1
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
kills()
end
end
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
08 Oct 2012 12:15 PM
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(character)
function death(humanoid, player)
player = plr
humanoid = character.Humanoid
local stats = player:FindFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:FindFirstChild("Deaths")
deaths.Value = deaths.Value + 1
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
kills()
end
end
end)
end)
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