How do I turn off the teleporter when winner is found?
I tried to disable the teleporter script but it looks like its not working. I tried game.Workspace.TpScript.Disabled = true
but it keeps sending player to the map.
Heres the main script that makes it to be disabled :
02 | local Player 1 = game.Players.PlayerAdded:wait() |
04 | Map 1 = game.ServerStorage.Maps.Arena 1 |
05 | NotificationGui 1 = game.Workspace.StatusBar.Gui 1. TextBox |
06 | NotificationGui 2 = game.Workspace.StatusBar.Gui 2. TextBox |
12 | game.Workspace.WinnerDetector.Touched:connect( function (Player) |
14 | Winner = Player.Parent.Parent.Name |
15 | Player.Parent.Humanoid.Health = 0 |
18 | NotificationGui 1. Text = "Please Wait" |
19 | NotificationGui 2. Text = "Please Wait" |
22 | NotificationGui 1. Text = "Current Map :" , Map 1. MapName |
23 | NotificationGui 2. Text = "Current Map :" , Map 1. MapName |
26 | NotificationGui 1. Text = "Loading..." |
27 | NotificationGui 2. Text = "Loading..." |
29 | Map 1 :clone().Parent = game.Workspace |
30 | Player 1. PlayerGui.WinnerGui.TextBox.Text = "Teleporting Players" |
31 | game.Workspace.TpScript.Disabled = false |
33 | NotificationGui 1 = "Game In Progress" |
34 | NotificationGui 2 = "Game In Progress" |
35 | Player 1. PlayerGui.WinnerGui.TextBox.Text = "Game In Progress" |
39 | Player 1. PlayerGui.WinnerGui.TextBox.Text = "Winner : " , Winner |
40 | game.Workspace.Map:destroy() |
41 | game.Workspace.TpScript.Disabled = true |
48 | NotificationGui 1. Text = "Game Ended" |
49 | NotificationGui 2. Text = "Game Ended" |
51 | Player 1. PlayerGui.WinnerGui.TextBox.Text = "Winner : Not Found" |
and the TpScript :
09 | Reciver = game.Workspace.Spawn.Spawn 1 |
10 | game.Workspace.TpSender.Touched:connect( function (part) |
11 | local hum = part.Parent:FindFirstChild( "Humanoid" ) |
13 | if enabled = = true then |
15 | local t = part.Parent:FindFirstChild( "Torso" ) |
17 | t.CFrame = CFrame.new(t 2. Position.x, t 2. Position.y+ 4 , t 2. Position.z) |
22 | Reciver = game.Workspace.Spawn.Spawn 2 |
24 | Reciver = game.Workspace.Spawn.Spawn 3 |
26 | Reciver = game.Workspace.Spawn.Spawn 4 |
28 | Reciver = game.Workspace.Spawn.Spawn 5 |
30 | Reciver = game.Workspace.Spawn.Spawn 6 |