I made a potion that heals your character then i publish the game then it doesnt work anymore
local CanActivate = true
local player = game.Players.LocalPlayer
local character = player.Character
function onActivation()
if CanActivate == true then
if CanActivate == true then
CanActivate = false
local animation = character.Humanoid:LoadAnimation(script.Parent.Animation)
animation:Play()
wait(1)
character.Humanoid.Health = character.Humanoid.Health + 50
wait(2)
CanActivate = true
end
end
end

4 comments
you should test in a local server in studio and check for any errors in the output. Localscripts are tricky when only running in test mode since the script can load before characters do
i tried and there where no errors
Run it online and press F9 to view the dev console and see if any errors print out there. Also if you could, post your code and I will take a look
when i press f9 and clicked no errors apeared