Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

For some reason it wont destroy itself or subtract from value??

whenever it dies it doesnt destroy it self or subtract from value

local mobnumb = game.ServerScriptService.DeathCheck.mobnumber
local hum = script.Parent

hum.Died:Connect(function()
    
    mobnumb.Value -= 1
    hum.Parent:Destroy()
    
end)

1 comment

0

Where is this script parented? Is it local or server?

1 answer

Hello! I've examined your script, and I am here to help.

I've found an issue on line 6

mobnumb.Value -= 1

That line of code is wrong, the correct code would be:

mobnumb.Value = (mobnumb.Value-1)

I'm not sure why you're trying to delete the player's character model but that should work If the value error gets fixed.

Make sure the script is not a LocalScript or It won't work as you're trying to set a value that's located in ServerScriptService meaning It has to be server-sided.

This discussion is preserved as it was. New answers, comments, and votes are closed.