So, i placed this localscript in a screengui, and a placed a textbutton on the screengui.
position = {Vector3.new(5,5,5),Vector3.new(34,45,0) script.Parent.MouseButton1Click:connect(function() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(position[math.random(#position)]) end)
position = {Vector3.new(5,5,5),Vector3.new(34,45,0) script.Parent.MouseButton1Click:connect(function() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(position[math.random(#position)]) end)
This code will not work because you shouldn't have a end) statement when you don't even have a starter statement, here's an example on what i think you were trying to do.
function onClick(mouse) position = Vector3.new(5,5,5),Vector3.new(34,45,0) game.Players.LocalPlayer.Character.Torso.CFrame =CFrame.new(position[math.random(#position)]) end script.Parent.MouseButton1Click:connect(OnClick)