script.Parent.MouseButton1Click:connect(function() Frame:TweenPosition(UDim2.new(0.5, -200, 0, -200)) end)
-- 18:03:14.153 - Players.Player1.PlayerGui.ScreenGui.Frame.Exit.LocalScript:2: attempt to index global 'Frame' (a nil value) 18:03:14.155 - Stack Begin 18:03:14.155 - Script 'Players.Player1.PlayerGui.ScreenGui.Frame.Exit.LocalScript', Line 2
Why isn't it working??
You forgot to define "Frame"
Here's the correct one!
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent:TweenPosition(UDim2.new(0.5, -200, 0, -200)) -- This is not sure. A button is mostly in a frame. So the parent of the button is now seleted to be tweened. end)
These faults can happen! Make sure to check your scripts multiple times. This is a starter fault. You will learn it how to fix it your self!
Hope I helped you! Have a good day.
It looks like you haven't defined the variable. If the frame you are referring to is the frame in the error directory (Players.Player1.PlayerGui.ScreenGui.Frame) then the proper way to address the frame would be "script.Parent.Parent".