How can I TweenSize the GUI when the a player comes in contact with a certain brick and it comes down but when they leave if the magnitude is less than 5, it goes away by going up. My GUI is called "Shop" and it's inside of the script.
function touch(hit)
if game.Players:findFirstChild(hit.Parent.Name) ~= nil then
local player = game.Players[hit.Parent.Name]
if player.PlayerGui:findFirstChild("Shop") == nil then
local gui = script.Shop:clone()
gui.Parent = player.PlayerGui
repeat
wait()
until (player.Character.HumanoidRootPart.Position - script.Parent.Position).magnitude > 5
gui:remove()
end
end
end
script.Parent.Touched:connect(touch)

2 comments
shouldn't that be tweenposition instead of tweensize?
Yeah sorry I mean't TweenPosition