Tween not playing on humanoid died

Ok so this is he conclusion:

  • 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)

Foggy is a BlurEffect as shown in an image in the 9th reply. So the “Size” property cannot be an Udim2 value.

ah okkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

Now this should solve the problem!!!

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.

Yes, you just have to do this:

TouchEvent = partt.Touched:Connect(onTouch)
partt.TouchEnded:Connect(onTouchEnded)

Char:FindFirstChildOfClass("Humanoid").Died:Connect(function()
	frame.Enabled = false
	TweenService:Create(frame, TweenInfo.new(2), {Size = 0}):Play()
	TouchEvent:Disconnect()
end)
2 Likes