If you put the script inside of the “StarterCharacterScript”, you can just get the character by using “script.Parent” (I know this isn’t useful to fix the problem but can let you know)
I don’t know what is foggy.
Last but not least, this script may help: (May help since I don’t know what frame is. I assume that frame is Frame UI and if it is that so why will you put that in Lighting?
local Character = script.Parent
local Frame = game.Lighting.Foggy
Character:WaitForChild("Humanoid").Died:Connect(function()
Frame.Enabled = true
TweenService:Create(Frame, TweenInfo.new(2), {Size = 16}):Play()
end)
Well, as I said before, I tested the original script and it worked fine. You are right in your reply, you can get the character with script.Parent is StarterCharacterScripts, but the other method also works, so this shouldn’t be a problem. Others also suggested printing something before the tween, and it did print. So the problem is not that it doesn’t detect when the player dies, it’s something with the tween or there is another script changing the blur size.
It may be the Touched connect function overriding the size 0 tween and preventing it from playing. Is there anyways to disconnect it? I tried doing Character:FindFirstChild("Humanoid").Died:Connect(onTouchEnded) -- This forces tween to play to size 0 but it doesn’t work.