Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help teleporting all players to a spawnpoint. Help?

I am making a round based game and need help teleporting the players to some parts (so they are spread out) but I don't know how to script this and need help.

2 comments

0

Is it multiple parts or just one?

0

it is multiple parts

1 answer

✓ Accepted answer

Sorry I don't know how to teleport people to multiple parts. But this may help.

Make a gui and add a text button. Put a local script within that text button and use the following script,

script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.TeleEvent:FireServer() --Make an event in replicated storage and name it "TeleEvent". 
end)

After that make a script in server script service and say this.

game.ReplicatedStorage.TeleEvent.OnServerEvent:Connect(function()

	for _, plr in pairs(game.Players:GetChildren()) do
           
		local part = game.Workspace.Telepart --Make a part that is named that.
                local pos = part.CFrame

		plr.Character.HumanoidRootPart.CFrame = CFrame.new(pos) 

	end

end)

This script will teleport everyone in the server to that part.

1 comment

0

i will try to use the same remote event in my main script for the game. Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.