Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Stuck on leaderstats Problem?

Asked by 4 years ago

I have tried putting a code in a tool whenever the humanoid is hit it goes to 0 health and also it gives you a certain amount of Cash, Xp, Kills. But whenever I kill someone it gives me a random amount of Cash Kills and Xp.

Here is the script:

local knife = script.Parent local handle = knife:WaitForChild("Handle")

local throwRE = knife:WaitForChild("ThrowKnife")

local throwAnim = script:WaitForChild("ThrowAnimation")

local cooldown = 3 local isCooldown = false

throwRE.OnServerEvent:Connect(function(plr, mouseHit)

01local character = plr.Character
02 
03local stats = plr:FindFirstChild("leaderstats")
04 
05local kills = stats:FindFirstChild("Kills")
06local xP = stats:FindFirstChild("XP")
07local DocDollars = stats:FindFirstChild("DocDollars")
08 
09if not character or not character:FindFirstChild("Humanoid") then return end
10 
11 
12if isCooldown then return end
13isCooldown = true
14 
15 
View all 71 lines...

end)

0
Thanks for all of you who have the heart to help me :) subblox1234 9 — 4y

Answer this question