local player = script.Parent.Parent.Parent.Parent
local playerc = player.Character
local P = playerc.Humanoid
while true do
wait(0.1)
if P.Health == 0 then
script.Parent.Parent.WastedBlur.Visible = true
script.Parent.Visible = true
script.Parent.LocalScript.Static:play()
wait(4)
script.Parent.Visible = false
script.Parent.Parent.Frame2.Visible = true
wait(1.5)
end
wait()
end
this script is in screen gui it is in a wested gui. so basically i want it to appear when the players health is 0. this works in single player roblox studio but it wont work on the roblox server. why wont it work on the roblox server?

2 comments
https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online
ty for the link it helped