hum.Died:Connect(function()
local tag = hum:FindFirstChild(“creator”)
if tag then
local player = tag.Value
local kills = player.leaderstats.Kills
kills.Value = kills.Value + 1
end
end)
What type of value is “creator” , any error in the script ? Also try debugging it by adding some prints Inside if conditions , like :
local hum = script.Parent.Humanoid
hum.Died:Connect(function()
local tag = hum:FindFirstChild(“creator”)
if tag then
print("Tag is not nil")
local player = tag.Value
local kills = player.leaderstats.Kills
kills.Value = kills.Value + 1
end
end)
11:46:47.250 Gun Skill Testing (Adding more guns soon!!) @ 03 feb 2021 11:46 auto-recovery file was created - Studio - C:/Users/Uzivatel/Documents/ROBLOX/AutoSaves
11:46:47.960 Humanoid is not a valid member of ServerScriptService “ServerScriptService” - Server - KillCredit:1
11:46:47.961 Stack Begin - Studio
11:46:47.961 Script ‘ServerScriptService.KillCredit’, Line 1 - Studio - KillCredit:1
11:46:47.961 Stack End - Studio
11:46:48.486 Failed to load sound rbxasset://sounds/swoosh.wav: Unable to download sound data (x14) - Studio
Where is the script located at ?
The line : local hum = script.Parent.Humanoid is erroring , make sure its inside the Character , if it is inside the Character try using WaitForChild.
says this 11:52:08.224 Failed to load sound rbxasset://sounds/swoosh.wav: Unable to download sound data (x6) - Studio
11:52:10.904 Banner_Dev applied edits to script KillCredit - Studio
11:52:11.417 Failed to load sound rbxasset://sounds/swoosh.wav: Unable to download sound data (x6) - Studio
11:52:13.918 Infinite yield possible on ‘ServerScriptService:WaitForChild(“Humanoid”)’ - Studio
11:52:13.918 Stack Begin - Studio
11:52:13.919 Script ‘ServerScriptService.KillCredit’, Line 1 - Studio - KillCredit:1
11:52:13.919 Stack End - Studio
Please answer my questions else It won’t be possible for me to help you, from the errors I found that your script is Inside ServerScriptService , move it into the Dummy’s Model.
Did you add it to all the Dummies ? If no add it to all the Dummies or use a loop.
Do this :
local hum = script.Parent.Humanoid
hum.Died:Connect(function()
print("Died")
local tag = hum:FindFirstChild(“creator”)
if tag then
print("Tag is not nil")
local player = tag.Value
local kills = player.leaderstats.Kills
kills.Value = kills.Value + 1
end
end)