What is wrong with this? I want the localscript to work. What I mean is when you click the gui you teleport to that place. How do you do this?
position = Vector3.new(0,0,0) -- CHANGE THIS TO THE POSITION
script.Parent.Button1Click:connect(function()
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(position)
end)

7 comments
so i put script.Parent.MouseButton1Click:connect(function() and im good?
Yep
works
Ok so one more thing how can I make it randomly choose a position to spawn for example, position = Vector3.new(0,0,0) and then theres 3 more that have different (34,45,0), so when the player clicks the gui it wont spawn just in one place it will spawn in one of those 3 randomly. How can I do that? Thank you.
Use a table to store the positions then randomly select one from the table position = {Vector3.new(0,0,0),Vector3.new(34,45,0) } script.Parent.MouseButton1Click:connect(function() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(position[math.random(#position)]) end)
whats a table sorry if this sounds dumb
https://scriptinghelpers.org/glossary/Table