|
| 16 Aug 2012 09:05 PM |
Im trying to make a GUI that shows your deaths but I cant seem to get my leaderboard to show my deaths whats wrong? Thanks!
function onplayerentered (newplayer) local stats = Instance.new("IntValue", newplayer) stats.Name = "leaderstats" local Level = Instance.new("IntValue", stats) Level.Name = "Level" local Stars = Instance.new("IntValue", stats) Stars.Name = "Stars" local Deaths = Instance.new("IntValue", stats) Deaths.Name = "Deaths" end function onHumanoidDied(humanoid, player) local stats = player:findFirstChild("leaderstats") if stats ~= nil then local Deaths = stats:findFirstChild("Deaths") Deaths.Value = Deaths.Value + 1
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
handleKillCount(humanoid, player) end end
function onPlayerRespawn(property, player) if property == "Character" and player.Character ~= nil then local humanoid = player.Character.Humanoid local p = player local h = humanoid humanoid.Died:connect(function() onHumanoidDied(h, p) end ) end end game.Players.PlayerAdded:connect(onplayerentered) |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2012 09:22 PM |
When you play it in solo mode, is there an IntValue in leaderstats called "Deaths"?
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2012 09:24 PM |
Are you sure it's not just hidden?
Try expanding the leaderboard.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2012 09:26 PM |
| yes i have a kill brick so i can test and my leaderbooard never changes so my GUi never changes |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2012 09:28 PM |
What I mean is press the button on the top left corner of the leaderboard.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2012 09:33 PM |
>You mean top right?
No.
There's nothing at the top right of the leaderboard.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 16 Aug 2012 09:36 PM |
| Didnt work any other ideas? if not thanks for your help. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2012 09:37 PM |
If an IntValue exists in leaderstats, it should technically be on the leaderboard.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2012 09:38 PM |
Is that the full script?
Because if it is, handleKillCount isn't a function.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2012 09:39 PM |
| It displays Deaths its just when I die it doesnt go up 1 |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2012 09:41 PM |
"handleKillCount(humanoid, player) end end"
Lolwhat? |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2012 09:41 PM |
There seems to be a lot of functions that don't exist that you are trying to call.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2012 09:42 PM |
| im a beginner could someone help me edit this? |
|
|
| Report Abuse |
|
|
| |
|
| |
|