spawn = game.Workspace.SpawnLocation1 player = script.Parent.Parent.Parent.Parent
function onClicked() player.Character:MoveTo(spawn.Position)
end
script.Parent.MouseButton1Down:connect(onClicked)?
spawn = game.Workspace.SpawnLocation1 player = script.Parent.Parent.Parent.Parent
function onClicked() player.Character:MoveTo(spawn.Position)
end
script.Parent.MouseButton1Down:connect(onClicked)?
Ok so im assuming this is a normal script, which wont work in an actual Roblox place in player gui although it will work in studio. But you would use the built in lua function called math.random You also are going to want a model with all of the spawns in it.
-- all of the spawns
Spawns = game.Workspace.Spawns:GetChildren()
player = script.Parent.Parent.Parent.Parent
function OnClicked()
-- chooses one of the 9 spawns randomly
local Spawn = Spawns[math.random(1,9)]
player.Character:MoveTo(spawn.Position)end
script.Parent.MouseButton1Down:connect(onClicked)
Hope this helps.
This discussion is preserved as it was. New answers, comments, and votes are closed.