Valorant
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 987 |
|
|
| 15 May 2013 10:45 PM |
local xp = Instance.new("IntValue") xp.Name = "XP" xp.Value= 0 print('Hi')
local level = Instance.new("IntValue") level.Name = "Level" level.Value = 1 print('1')
function getKillerOfHumanoidIfStillInGame(humanoid) local tag = humanoid:findFirstChild("creator") if tag ~= nil then local killer = tag.Value if killer.Parent ~= nil then -- killer still in game return killer end end return nil end
function handleKillCount(humanoid, player) local killer = getKillerOfHumanoidIfStillInGame(humanoid) if killer ~= nil then local stats = killer:findFirstChild("leaderstats") if stats ~= nil then local kills = stats:findFirstChild("XP") if killer ~= player then kills.Value = kills.Value + 100 else kills.Value = kills.Value - 100 end end end end
function onxpChanged(player, XP, level) if xp.Value>=level.Value * 10 then xp.Value = xp.value - level.Value * 10 level.Value = level.Value + 1 end end
I don't see anything wrong with it but when we join the game the leadboard doesn't pop up at all. |
|
|
| Report Abuse |
|
|
|
| 15 May 2013 10:48 PM |
| you haven't inserted leaderstats |
|
|
| Report Abuse |
|
|
|
| 15 May 2013 10:50 PM |
| start the script by inserting the playerstats |
|
|
| Report Abuse |
|
|
Valorant
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 987 |
|
| |
|