Whenever You Step On The Part It Opens/Tweens The Gui Perfectly, But Once You Close It And Try To Open It Again, It Doesn't Open?
It Might Because I Opened It From A Client And Closed It Locally, But I'm Not Sure How To Fix This?
Part Serverscript
CanOpen = true
function onTouched(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if CanOpen == true then
local shop = plr:WaitForChild("PlayerGui")
local Main = shop.Main.PopUps.MainShopBag:TweenPosition(UDim2.new(0.298, 0,0.537, 0),nil, nil, 1)
CanOpen = false
wait(1)
CanOpen = true
end
end
end
script.Parent.Touched:connect(onTouched)
GUI Close Script
script.Parent.Activated:Connect(function()
script.Parent.Parent:TweenPosition(UDim2.new(0.298, 0,-0.537, 0), nil, nil, 1)
end)

1 comment
For the touched script it would work better if it were a "normal" function instead of calling the function later on.