Teleporting all players to specific player

He said that there are multiple players needed to activate it.

Oh, so like it needs 2 people to touch the part and it works?

I was assuming he meant that which is why I wrote this whole giant code.
Which allows you to set the Max Players needed to activate.

@Koki0991 So, just give more context if you can so that I could help you better.

Here’s a script for you.

local Connection

Connection = script.Parent.Touched:Connect(function(hit)
	local Player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
	
	if Player and Player.Character and Player.Character.HumanoidRootPart then
		for i, v in pairs(game.Players:GetPlayers()) do
			if v.Character and v ~= Player then
				local NewPivot = v.Character:GetPivot() * CFrame.new(Player.Character.HumanoidRootPart.Position)
				v.Character:PivotTo(NewPivot)
			end
		end
		
		print("Teleported players because "..Player.Name.." activated")
		Connection:Disconnect()
	end
end)

As it seems you originally wanted, judging by your use of :Once() this event will only fire one time
If you would like to change this functionality, remove the

Connection:Disconnect()

Hope this is what you’re looking for!

my game contains solo + 2 - 4 players if I set it to 4 players max can 1 player active it?

nvm that works thanks for help

You are welcome. Have an amazing day! Let us know if you need anymore help.

1 Like