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
 

Does anyone know what's wrong with this?

Previous Thread :: Next Thread 
Valorant is not online. 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
Mebalber123 is not online. Mebalber123
Joined: 21 Jan 2013
Total Posts: 219
15 May 2013 10:48 PM
you haven't inserted leaderstats
Report Abuse
Mebalber123 is not online. Mebalber123
Joined: 21 Jan 2013
Total Posts: 219
15 May 2013 10:50 PM
start the script by inserting the playerstats
Report Abuse
Valorant is not online. Valorant
Joined: 02 Apr 2013
Total Posts: 987
15 May 2013 10:54 PM
Oh shoot,

Thanks lol.
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