Wait, lol, it’s rn 11 pm, i need to sleep so yeah. Imma think…
Still doesn’t work with the loop is roblox really messed up or something lol
The script you posted seemed to work fine for me, are you getting any errors?
Also make sure the script is inside the character and is a serverscript.
Well, it will be hard you know, you will have to: Any time you damage a player, create a “creator” tag.
its inside the character and is a regular script
Is there something wrong with the humanoid or something?
To know who killed the npc, and to know who to give kills.
You’re verifying deaths not kills, whenever a guy dies, he gets kills by 1 and the script you gave can’t be verified at npcs.
The value to be changed is in workspace and isn’t a leaderstats thing. Also this script is running inside an npc cloned from replicated storage, would that change anything?
If you want to verify deaths, it’s okay, but if you want to verify kills, then it’s not okay. (because the script is wrong)
Try debugging your code:
print("Running")
local character = script.Parent
local value = workspace.NPCsKilled
local humanoid = character:WaitForChild("Humanoid", 5)
if not humanoid then
return warn("Unable to get humanoid")
end
humanoid.Died:Connect(function()
value.Value = value.Value + 1
print(character.Name .. " has died!")
end)
Ok Ill try it. The clones are being cloned into workspace so i dont see a problem with that
Wait, lmao, you are right, scripts don’t run in replicatedstorage.
I gotta go, bye guys. Sadboy#6780
It prints running to the console, but doesnt do anything else
local Character = script.Parent
local Humanoid = Character:FindFirstChild("Humanoid")
Humanoid.HealthChanged:Connect(function()
if Humanoid.Health == 0 then
print("here")
-- Prints "here"
end
end)
Put the script in the dummy (npc):
https://gyazo.com/5d4c085a554215a835496e0b1805a313
Thank you! Let me try it out real quick.
This isnt working for me either