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

:MoveTo() Suddenly doesn't work!?

Asked by
Ben1925 25
9 years ago

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.

001local pressed = false
002 
003function main()
004if not pressed then
005 
006        pressed = true
007        local announce = Instance.new("Hint", game.Workspace)
008 
009        print("[D] MasterScript: Setting config path")
010        local config = game.Workspace.Configurations
011 
012        print("[D] MasterScript: Setting Plate path")
013        local Plate1 = game.Workspace.Plate1
014        local Plate2 = game.Workspace.Plate2
015 
View all 142 lines...

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

0
You could try changing the Torso's position darkelementallord 686 — 9y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

Player1 and Player2 refer to the Character objects. After line 86, you know someone has died. Then on line 91/95, you wait 12 seconds. The dead character has respawned. If Player1 died, Player1 is gone now and there's a new character that you don't have. You're still trying to teleport the dead one.

Solution: after waiting those 12 seconds, re-define Player1 and Player2:

1Player1=Player1plr.Character
2Player2=Player2plr.Character
Ad

Answer this question