Hey there I want it so as soon as the players join they get teleported to a part. however only 1 player gets teleported and the others dont. I urgently need to fix this. thanks.
game.Players.PlayerAdded:Connect(function(plr)
for i, players in pairs(game.Players:GetChildren()) do
plr.CharacterAdded:Connect(function()
if respawned == false then
players.Character:WaitForChild("HumanoidRootPart").CFrame = game.Workspace.SpawnPart.CFrame
respawned = true
end
end)
end
regularsound:Play()
plr.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").BreakJointsOnDeath = false
end)
You want every time a player joins, for all players to be transported to the brick together? Meaning as a player in the game every time someone joins you get reset to a position? If this isn’t what you want please explain better because I’m having trouble following what you’re trying to do
plr.CharacterAdded:Connect(function()
for i, player in pairs(game.Players:GetPlayers()) do
local PlrsCharacter = player:FindFirstChild("Character")
if PlrsCharacter then
player.Character:WaitForChild("HumanoidRootPart").CFrame = game.Workspace.SpawnPart.CFrame
end
end
end)
This will make every player that join the server teleport to the part which is a type part. Lemme know if you need anything else.
local Players = game:GetService("Players")
local Part -- assign to part
Players.PlayerAdded:Connect(function(plr)
-- waits for character to load ingame
plr.CharacterAdded:Wait()
local character = plr.Character
character:SetPrimaryPartCFrame(Part.CFrame)
end)