Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script isnt Teleporting players in Round System?

Asked by 2 years ago
Edited 2 years 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 121 — 2y
0
Try doing HumanoidRootPart.CFrame = CFrame.new(ClonedMap.TeleportPoint.Position) manith513 121 — 2y
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 — 2y

2 answers

Log in to vote
0
Answered by
manith513 121
2 years ago

Also try doing

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

Ad
Log in to vote
0
Answered by
NykoVania 231 Moderation Voter
2 years 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 — 2y
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 231 — 2y

Answer this question