Hello, I am creating a battle royale game, but my lobby party teleport system isn't functioning! There's no error statements in the OutPut, and as far as I can see, nothing wrong with the script itself! It's placed in a LOCALSCRIPT inside the teleport part. Please help!
local Part = script.Parent
script.Parent.Touched:Connect(function(hit)
local tableOfParts = Part:GetTouchingParts()
local numberOfPlayers = 0
for i,v in pairs(tableOfParts) do
if v:FindFirstChild("Humanoid") then
numberOfPlayers = numberOfPlayers + 1
end
end
if numberOfPlayers == 2 then
for i,v in pairs(tableOfParts) do
if v:FindFirstChild("Humanoid") then
local plr
game:GetService("Players"):GetPlayerFromCharacter(v)
game:GetService("TeleportService"):Teleport(2978237413,plr)
end
end
end
end)

1 comment
omg use indents