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
|
  |
| 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
|
  |
| Joined: 12 Oct 2011 |
| Total Posts: 54 |
|
|
| 31 Dec 2016 06:49 AM |
| I have no idea how to do that |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 01 Jan 2017 06:00 PM |
| you put it in a server script in ServerScriptService or Workspace or ReplicatedStorage |
|
|
| Report Abuse |
|
|