So basically the function of this script is supposed to be this:
Once a certain player in the game dies, a block is destroyed. [In this case myself, PoInareffe] I don't know which part of the script is broken, though I have tried to test each part of the script alone with a 'print' though it shows no real results.
I am also getting an error at the "victim.hum.Health == 0 then" line which is saying "Syntax error: Expected identifier when parsing expression, got 'then'". I am not sure what to make of this except the fact that the 'then' is probably not supposed to be there though I do not know what to replace it with. Any help with fixing this would be appreciated!
local victim = game.Players:FindFirstChild("PoInareffe")
local char = victim.Character
local hum = char.Humanoid
local lay = game.Workspace.PlaceDie.Lay.Part
victim.hum.Health == 0 then
lay:Destroy()
end
I am relatively new to scripting so excuse my messy script.

1 comment
Oh I forgot to mention that this is a normal Script inside of the Workspace.