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

Why does it teleport players who have not touched the object?

local boat = game.Workspace.movingboat.MovingModel
local TeleportService = game:GetService("TeleportService")
local code = TeleportService:ReserveServer(6597645798)

local placeId = 6597645798

local function onPartTouch(otherPart)
	local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
	local players = game.Players:GetChildren()
	if #players >= 4 then
		wait(5)
		TeleportService:TeleportToPrivateServer(placeId, code, players)
	end
end
script.Parent.Touched:Connect(onPartTouch)

Help, lol. It seems if there is 4 people in the server, it will teleport all the players even if they have not touched the desired part.

1 answer

✓ Accepted answer

It is because you sent "Players"

That will teleport all the players in the server.

Instead, send just player. Get rid of the s

:)

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