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.
Closed as Not Constructive by Shawnyg
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?