Line 12 errors out and says ')' expected near ','
Pass= script.Parent.Parent.Parent.Passcode function Clicked() for i=1, 10 do wait(0.1) script.Parent.ImageTransparency = script.Parent.ImageTransparency +0.1 end wait(0.3) script.Parent.Parent.Visible = false for b=1,600 do wait(0.1) Pass.Position.Vector2.new = Pass.Postion + (0,+0.1)(0,0) --errors out end end script.Parent.MouseButton1Down:connect(Clicked)
Change this:
Pass.Position.Vector2.new = Pass.Postion + (0,+0.1)(0,0) --errors out
to this:
Pass.Position = Pass.Position + UDim2.new(0, 0.1, 0, 0)
UDim2 is the name for the data type where x and y each have a scale and an offset. In the properties menu you can set them to { 0, 0.1 }, { 0, 0 } but in Lua you need to use the UDim2 constructor.
These scripts normally work like this:
local gui = game.StarterGui.ScreenGui local amount = math.random(1,100) while true do wait(1) gui.Frame.TextBox.Position = gui.Frame.TextBox.Position + UDim2.new(0,amount) wait(5) gui.Frame.TextBox.Position = gui.Frame.TextBox.Position - UDim2.new(0,amount) end
This is a complicated example, but it works. First, we get the Gui, then we get the Amount to add (Right now, it's a random number from 1 to 100). We start while true do to loop this script, then add a random number onto the y axis. Then we wait 5 seconds. After five seconds, it subtracts a random number to stop the textBox from getting out of your view (Well, for a while).