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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Adding XP to a players leaderstats when eh kills someone.

Previous Thread :: Next Thread 
jamesdel is not online. jamesdel
Joined: 12 Oct 2011
Total Posts: 54
31 Dec 2016 05:57 AM
Hey, iv'e been trying for a long time to create a script that adds xp to the players leaderboard when they kill someone, thanks!
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
31 Dec 2016 06:08 AM
got a damage script in weapon?

just do something like

PlayerFighting.humanoid.HealthChanged:connect(function()
if fighting.humanoid.Health <= 0 then
--add xp to leaderstats
end
end)

Report Abuse
jamesdel is not online. jamesdel
Joined: 12 Oct 2011
Total Posts: 54
31 Dec 2016 06:49 AM
I have no idea how to do that
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
31 Dec 2016 06:50 AM
for i, player in ipairs(game.Players:GetPlayers()) do
local humanoid = player.Character:WaitForChild("Humanoid")
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
if tag.Value.Parent == game.Players then
local killer = tag.Value
if killer:FindFirstChild("leaderstats") then
killer:FindFirstChild("leaderstats"):WaitForChild("Exp").Value = killer:FindFirstChild("leaderstats"):WaitForChild("Exp").Value + 100
end
end
end
end
end
Report Abuse
jamesdel is not online. jamesdel
Joined: 12 Oct 2011
Total Posts: 54
01 Jan 2017 04:19 AM
Do i just copy and paste this sin to a script in the workspace or do i need to change things like creator, Thanks
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
01 Jan 2017 06:00 PM
you put it in a server script in ServerScriptService or Workspace or ReplicatedStorage
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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