:MoveTo() Suddenly doesn't work!?
Hi guys, I was making a 1v1 system, when another unusual problem popped up:
THE PROBLEMATIC LINE IS AT AROUND 107-108!
The purpose of this script is to TP the players into the arena, then freeze them (In order for them to prevent moving) and then once the timer reaches zero, unfreeze them. Now, I wanted to make a round system (So that you could configure how many rounds a certain match should have) it works fine, but I want it so that once the player RESPAWNS, He/she tps back into the arena. For some really weird reason, Roblox READS those lines without ANY error, it even* PRINTS* what I've put in there. But it doesn't tp the players back in. Output is what is expected, the only problem is that it doesn't teleport the players back in. For some weird reason.
007 | local announce = Instance.new( "Hint" , game.Workspace) |
009 | print ( "[D] MasterScript: Setting config path" ) |
010 | local config = game.Workspace.Configurations |
012 | print ( "[D] MasterScript: Setting Plate path" ) |
013 | local Plate 1 = game.Workspace.Plate 1 |
014 | local Plate 2 = game.Workspace.Plate 2 |
016 | print ( "[D] MasterScript: Setting Plate Teleport Path" ) |
017 | local Tele 1 = game.Workspace.Plate 1 _teleport |
018 | local Tele 2 = game.Workspace.Plate 2 _teleport |
020 | print ( "[D] MasterScript: Checking if Players are still here..." ) |
021 | local Player 1 = game.Workspace:FindFirstChild(Plate 1. whostepped.Value) |
022 | local Player 2 = game.Workspace:FindFirstChild(Plate 2. whostepped.Value) |
024 | print ( "[D] MasterScript: Checking fight dependencies" ) |
025 | local SwordTemplate = game.ReplicatedStorage.ClassicSword |
027 | if Plate 1. stepped.Value = = true and Plate 2. stepped.Value = = true then |
029 | local rounds = config.RoundNumber.Value |
031 | if Player 1 = = nil then |
032 | print ( "[D] MasterScript: Player 1 left! Cancel game!" ) |
033 | announce.Text = ( "Player 1 left. Game cannot continue!" ) |
039 | if Player 2 = = nil then |
040 | print ( "[D] MasterScript: Player 2 left! Cancel game!" ) |
041 | announce.Text = ( "Player 2 left. Game cannot continue!" ) |
047 | announce.Text = ( "Game commencing with " ..Player 1. Name.. " and " ..Player 2. Name) |
049 | announce.Text = ( "With a total of " ..config.RoundNumber.Value.. " rounds" ) |
051 | Player 1. Torso.Anchored = true |
052 | Player 2. Torso.Anchored = true |
054 | Player 1 :MoveTo(Tele 1. Position) |
055 | Player 2 :MoveTo(Tele 2. Position) |
057 | Plate 1. stepped_script.Disabled = true |
058 | Plate 2. stepped_script.Disabled = true |
064 | announce.Text = i.. " seconds remaining!" |
067 | announce.Text = "Fight!" |
069 | local Player 1 plr = game.Players:GetPlayerFromCharacter(Player 1 ) |
070 | local Player 2 plr = game.Players:GetPlayerFromCharacter(Player 2 ) |
072 | local Player 1 Sword = SwordTemplate:Clone() |
073 | local Player 2 Sword = SwordTemplate:Clone() |
075 | Player 1 Sword.Parent = Player 1 plr.Backpack |
076 | Player 2 Sword.Parent = Player 2 plr.Backpack |
078 | Player 1. Torso.Anchored = false |
079 | Player 2. Torso.Anchored = false |
081 | while config.RoundNumber.Value ~ = 0 do |
083 | while Player 1 :WaitForChild( "Humanoid" ).Health ~ = 0 and Player 2 :WaitForChild( "Humanoid" ).Health ~ = 0 do |
085 | announce.Text = "Game in progress with " ..Player 1. Name.. " and " ..Player 2. Name.. " with " ..config.RoundNumber.Value.. " rounds" |
088 | if Player 1. Humanoid.Health = = 0 then |
089 | announce.Text = Player 2. Name.. " wins this round" |
090 | config.RoundNumber.Value = config.RoundNumber.Value - 1 |
093 | announce.Text = Player 1. Name.. " wins this round" |
094 | config.RoundNumber.Value = config.RoundNumber.Value - 1 |
099 | print ( "[D] MasterScript: Clearing backpacks" ) |
100 | Player 1 plr.Backpack:ClearAllChildren() |
101 | Player 2 plr.Backpack:ClearAllChildren() |
102 | print ( "[D] MasterScript: Backpacks cleared" ) |
104 | Player 1 :MoveTo(Vector 3. new( 1 , 1 , 1 )) |
105 | Player 2 :MoveTo(Vector 3. new( 1 , 1 , 1 )) |
107 | print (Player 1. Name.. " and " ..Player 2. Name) |
108 | Player 1 :MoveTo(game.Workspace.Plate 1 _teleport.Position) |
109 | print ( "[D] MasterScript: Successfully moved Player1 back" ) |
110 | Player 2 :MoveTo(game.Workspace.Plate 2 _teleport.Position) |
111 | print ( "[D] MasterScript: Successfully moved Player2 back" ) |
113 | Player 1. Torso.Anchored = true |
114 | Player 2. Torso.Anchored = true |
118 | announce.Text = i.. " second intermission" |
121 | Player 1. Torso.Anchored = false |
122 | Player 2. Torso.Anchored = false |
124 | announce.Text = "Fight!" |
126 | local Player 1 Sword = SwordTemplate:Clone() |
127 | local Player 2 Sword = SwordTemplate:Clone() |
129 | Player 1 Sword.Parent = Player 1 plr.Backpack |
130 | Player 2 Sword.Parent = Player 2 plr.Backpack |
141 | workspace.Plate 1. Touched:connect(main) |
142 | workspace.Plate 2. Touched:connect(main) |
I'm just flabbergasted now. I don't understand what's going wrong with it. Maybe it's my stupidity or something, but I'm not giving up so quick. I need your help though. Please help me, This is getting ridiculous. If you need the full code I can give it to you.
Edit: Formatting