Uh so i tried to teleport players before and it works fine. But for some reason it is not working today. Here is my code:
1 | wait( 10 ) |
2 | for i,v in pairs (game.Players:GetPlayers()) do |
3 | v.Character:WaitForChild( "HumanoidRootPart" ).CFrame = CFrame.new( 3 , 3 , 3 ) |
4 | end |
5 | print ( "done" ) |
It prints 'done' without teleporting the player. I have no idea what happened. Anybody can solve this? Thanks.
I think you should use this:
1 | local Players = game:GetService( "Players" ) |
2 |
3 | for i, plrs in pairs (Players:GetPlayers()) do |
4 | plrs.Character:SetPrimaryPartCFrame(CFrame.new(YOURPOS)) |
5 | end |
YOURPOS is the vector3value or CFrame value that is gonna be inputted. Replace the YOURPOS with a value or make it a variable with that value. Hope this works and if this one doesn't follow the one above mine.
Try this:
01 | local s = script.Stat |
02 | t = 0 |
03 | while true do |
04 | t = 15 |
05 | repeat |
06 | t = t- 1 |
07 | s.Value = “Intermission.. “..t |
08 | wait( 1 ) |
09 | until t = = 0 |
10 | s.Value = “Game starting!” |
11 | wait( 2 ) |
12 | local plrs = game.Players:GetChildren() |
13 | for i = 1 , #plrs do |
14 | local num = math.random( 1 , 32 ) |
15 | plrs [ i ] .Character.Head.CFrame = CFrame.new(workspace.Teleports [ “Part”..num ] .Position) |
I think you should replace CFrame with Vector3, like this:
wait(10)
1 | for i,v in pairs (game.Players:GetPlayers()) do |
2 | v.Character:WaitForChild( "HumanoidRootPart" ).CFrame = Vector 3. new(POSITION) |
3 | end |
4 |
5 | print ( "done" ) |
(Remember to replace "POSITION" with the position that you want to teleport the players.)
Good luck!