Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Local scripts not working in Game after i publish it?

Asked by 6 years ago
Edited 6 years ago

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

0
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 Legoman654 100 — 6y
0
i tried and there where no errors TheS3cret 0 — 6y
0
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 Legoman654 100 — 6y
0
when i press f9 and clicked no errors apeared TheS3cret 0 — 6y

Answer this question