So im trying to make a tween position for a gui when the player touches the part and im useing flags aka Debounces. And it only runs the tween once. I also have a local script that removes the gui when you press exit button just incase thats the problem
local part = script.Parent
local flag = true
part.Touched:Connect(function(hit)
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr and flag then
plr.PlayerGui.BuyGui.Frame:TweenPosition(UDim2.new(0.287, 0, 0.325, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.5)
flag = false
print("yes")
wait(1)
flag = true
end
end)