I've made a script where if you touch a brick, it enables a gui and makes a tween animation however the animation will only work the first time it is activated, how can I fix this? (I'm a beginner at scripting so any advice is very helpful)
local player = game.Players.LocalPlayer
workspace.telexd.Touched:connect(function(hit)
player.PlayerGui.ScreenGui.Enabled = true
player.PlayerGui.ScreenGui.TextLabel:TweenPosition(UDim2.new(0.423,0,0.812,0), 'Out', 'Elastic',1.5)
wait(5)
player.PlayerGui.ScreenGui.Enabled = false
wait(.1)
player.PlayerGui.ScreenGui.Enabled = true
wait(.1)
player.PlayerGui.ScreenGui.Enabled = false
wait(.1)
player.PlayerGui.ScreenGui.Enabled = false
end)

1 comment
LocalPlayer is nil on the server.