Ad
Log in to vote
0

Script isnt Teleporting players in Round System?

Asked by 22 days ago
Edited 22 days ago

So I have a Lobby and Playing team and i would like the players in the Lobby team to teleport to the map and also set their team to the Playing team and vice versa when the game ends, but it doesn't seem to work and the output doesn't have any errors.

My Script:

    local playersinlobby = lobbyteam:GetPlayers()

    for i, v in pairs(playersinlobby) do

        local Character = v.Character

        local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

        if Character then
            HumanoidRootPart.CFrame = ClonedMap.TeleportPoint.CFrame

        wait(2)


            v.Team = playingteam

end
    end 

I would like to know the reason why.

Thanks.

0
It looks fine to me, does anything happen at all? manith513 61 — 22d
0
Try doing HumanoidRootPart.CFrame = CFrame.new(ClonedMap.TeleportPoint.Position) manith513 61 — 22d
0
sorry for making you wait but yes everything works except the teleporting parts i could send the whole script if needed User#49447 0 — 21d

2 answers

Log in to vote
0
Answered by 22 days ago

Also try doing

Character:SetPrimaryPartCFrame(CFrame.new(ClonedMap.TeleportPoint.Position))

Ad
Log in to vote
0
Answered by
NykoVania 198 Moderation Voter
22 days ago

Try using this

Character:MoveTo(Vector3.new(0,0,0)) -- change the pos to ur teleport points location
0
I would but I dont know or wouldnt be able to make it with multiple maps that are chosen randomly cuz that how my script works i can send the whole script if that helps. User#49447 0 — 21d
0
If you want to I could look at the whole script, but there's a value called a Vector3 value that you can use to store the map position and turn it into a variable. NykoVania 198 — 21d

Answer this question