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)
I think you're right, in that it does have to do with the server/local scripts. The reason it can open/close is because it must be set to closed at first, then the server opens it, and local scripts can read server-side changes so the local script knows it's open, and can close it. But, it can't open a second time, because the server script can't detect that the local script closed it.
An easy way to fix this, is to just put the .Touched event into the local script as well. Local scripts can still detect touches.