#roblox leaderstats problem script
52 messages · Page 1 of 1 (latest)
local mouse = game.Players.LocalPlayer:GetMouse()
local cas = game:GetService("ContextActionService")
local plr = game.Players.LocalPlayer
local c = plr.Character or plr.CharacterAdded:Wait()
local h = c:WaitForChild("Humanoid")
local tool = plr.Backpack:FindFirstChild("Hammer")
local alreadyCounted = false
tool.Activated:Connect(function()
wait(0.5)
local animator = h:WaitForChild("Animator")
if animator then
local animation = animator:LoadAnimation(tool:FindFirstChild("Animation"))
animation:Play()
end
if mouse.Target then
local model = mouse.Target.Parent
if model and model:FindFirstChild("Humanoid") and model:FindFirstChild("Humanoid").Health > 0 and model ~= c then
local humanoid = model:FindFirstChild("Humanoid")
humanoid.Died:Connect(function()
if not alreadyCounted then
plr.leaderstats.Kills.Value = plr.leaderstats.Kills.Value + 1
alreadyCounted = true
end
end)
end
end
end)
I have corrected the code. Here is the correct version that should work for you. I hope it helps!
@vital current
** You are now Level 1! **
it's work?
Look this.
i already did
it's work?
wait
i need vouch for get scripter role :)
i'll wait
wait the location for this script is the same ?
and i have a question , isnt the client script is the same as the local script
yes
OHH
** You are now Level 2! **
My bad
But yes
Hey??
ay bro so the script location is the same wich is startercharacterservice and its a local script ?
and sorry for being lat
** You are now Level 7! **
e
Yes
ok ok
u did???
wait im trying to see whats going on
umm?
idk bro my tool dont work no more idk what happend
u good when i solve all of this i will tell u
lol the problem was is when u corrected my script you removed the fire event line and that broke my tool i couldent figure it out fast bc im new i fix it now
and i just tested it wit ur corrected script and it didnt work
it count only 1 kill and dont count any other kills
@ornate trout
mhm
its still counting 1 kill only and not counting other kills
u fix??
yea i did