Not sure it's possible but so errors show while testing this script?
function move(Gui) game.StarterGui.GuiMain.Frame:TweenPosition(UDim2.new(0.001,0,0,0),"Out", "Quad", .9) end function onTouch(part) move(script.Parent) end
I'ma bit new to tweening, any tips on tweening would help me!
I don't know if it's when you hit a part in Workspace
, but if it is then this works
function move(Gui) game.StarterGui.GuiMain.Frame:TweenPosition(UDim2.new(0.001,0,0,0),"Out", "Quad", .9) end function onTouch(part) move(script.Parent) end game.workspace.PARTNAMEHERE.Touched:connect(onTouch)
I'm not sure if you included a listener on the .Touched event.
I think you meant:
yourPart = game.Workspace.ExamplePart; function move(Gui) Gui:TweenPosition(UDim2.new(0.001,0,0,0),"Out", "Quad", .9) end function onTouch(part) move(script.Parent) end yourPart.Touched:connect(onTouch);
Also, I would suggest putting the tweening function into a LocalScript and the touched listener into a normal script or else it might not work correctly. I would suggest allowing the normal script to call the tweening function using a remote event.