Hello, I’ve made a silly little drink that basically gives you a large speed boost at the expense of your HP draining, I’ve also made a cure for it, which works fine…
What doesn’t work though, is the script that makes it stop when you die.
local plr = game:GetService("Players").LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()
local hum = chr:WaitForChild("Humanoid")
Line 2 is your error. Character in that case is a property/reference of the Player not a file.
That works sometimes because your Character is actually loaded but at times that may take a moment. Then that line will Infinite yield. So you do it both ways with that added CharacterAdded:Wait() line. If the reference is not loaded yet it will OR to wait for the Character.
But: local char = player:WaitForChild(“Character”) is always a miss call, due to this.