SHOW:
|
|
- or go back to the newest paste.
1 | - | local quickPlaceID = 1818 -- Change this if you want to have your placeID ready in the textbox so you don't have to copy/paste and waste time. |
1 | + | local quickPlaceID = 343078108 -- Change this if you want to have your placeID ready in the textbox so you don't have to copy/paste and waste time. |
2 | local justGo = false -- Change this if you want to teleport people immediately when the GUI is inserted. Make sure you have a placeID set in quickPlaceID. | |
3 | ||
4 | local whitelistPlayers = {} -- People who you don't want to teleport. | |
5 | ||
6 | ||
7 | local GUI = game:GetObjects("rbxassetid://281287169")[1]:Clone() | |
8 | GUI.Parent = game.Players.LocalPlayer.PlayerGui | |
9 | script.Parent = GUI | |
10 | ||
11 | local mainWindow = GUI:WaitForChild("Window") | |
12 | local mainWindowContent = mainWindow:WaitForChild("Main") | |
13 | local outputBase = mainWindowContent:WaitForChild("OutputText") | |
14 | local outputBox = mainWindowContent:WaitForChild("Output") | |
15 | local Settings = mainWindowContent:WaitForChild("Settings") | |
16 | local ToId = mainWindowContent:WaitForChild("PlaceID") | |
17 | local GoButton = mainWindowContent:WaitForChild("GOButton") | |
18 | local AutoButton = Settings:WaitForChild("AutoSetting") | |
19 | ||
20 | local PID = "" | |
21 | local LocatedTeleporter = "" | |
22 | local located = false | |
23 | local foundTele = "" | |
24 | local speedrun = false | |
25 | ||
26 | ToId.Text = tostring(quickPlaceID) | |
27 | ||
28 | function RecursiveSearch(obj, objname) -- Old ALX Function | |
29 | local foundObj = false | |
30 | for i,v in pairs(obj:GetChildren()) do | |
31 | if v.Name == objname then | |
32 | foundObj = v | |
33 | end | |
34 | end | |
35 | return foundObj | |
36 | end | |
37 | ||
38 | function FindTeleporter(root) | |
39 | for i,v in pairs(root:GetChildren()) do | |
40 | if RecursiveSearch(v,"TouchScript") and RecursiveSearch(v,"teleBeam1") then | |
41 | foundTele = v | |
42 | return | |
43 | end | |
44 | FindTeleporter(v) | |
45 | end | |
46 | if game.PlaceId == 183364845 then | |
47 | foundTele = workspace.TpToNextWorld | |
48 | speedrun = true | |
49 | return | |
50 | end | |
51 | end | |
52 | ||
53 | function printOutput(str) | |
54 | for i,v in pairs(outputBox:GetChildren()) do | |
55 | if v.Position.Y.Offset < 10 then | |
56 | v:Destroy() | |
57 | end | |
58 | v.Position = UDim2.new(0,0,0,v.Position.Y.Offset-20) | |
59 | end | |
60 | local newOutput = outputBase:Clone() | |
61 | newOutput.Position = UDim2.new(0,0,0,285) | |
62 | newOutput.Parent = outputBox | |
63 | newOutput.Text = str | |
64 | newOutput.Visible = true | |
65 | end | |
66 | ||
67 | function locateTeleporter() | |
68 | FindTeleporter(workspace) | |
69 | if foundTele == false then | |
70 | printOutput("Teleporter not found. Cannot continue.") | |
71 | else | |
72 | if RecursiveSearch(foundTele,"PlaceId") then | |
73 | printOutput("Teleporter found... Masking...") | |
74 | for i,v2 in pairs(foundTele:GetChildren()) do -- Masks your teleporter | |
75 | if v2:isA("BasePart") then | |
76 | if RecursiveSearch(v2,"Decal") then | |
77 | v2.Decal:Destroy() | |
78 | end | |
79 | v2.Transparency = 1 | |
80 | v2.Anchored = true | |
81 | v2.CanCollide = false | |
82 | end | |
83 | end | |
84 | PID = foundTele.PlaceId | |
85 | print(PID) | |
86 | LocatedTeleporter = foundTele | |
87 | located = true | |
88 | elseif RecursiveSearch(foundTele.TouchScript.TeleportScript, "PlaceId") then | |
89 | printOutput("Teleporter found... Masking...") | |
90 | for i,v2 in pairs(foundTele:GetChildren()) do -- Masks your teleporter | |
91 | if v2:isA("BasePart") then | |
92 | if RecursiveSearch(v2,"Decal") then | |
93 | v2.Decal:Destroy() | |
94 | end | |
95 | v2.Transparency = 1 | |
96 | v2.Anchored = true | |
97 | v2.CanCollide = false | |
98 | end | |
99 | end | |
100 | PID = foundTele.TouchScript.TeleportScript.PlaceId | |
101 | LocatedTeleporter = foundTele | |
102 | located = true | |
103 | else | |
104 | printOutput("Incompatible teleporter.") | |
105 | end | |
106 | end | |
107 | end | |
108 | ||
109 | function checkWhitelist(name) | |
110 | for i,v in pairs(whitelistPlayers) do | |
111 | if v == name then | |
112 | return false | |
113 | end | |
114 | end | |
115 | return true | |
116 | end | |
117 | ||
118 | function Place() | |
119 | local placeID = ToId.Text | |
120 | if #game.Players:GetChildren() - 1 - #whitelistPlayers == 0 then | |
121 | printOutput("No players to teleport.") | |
122 | return | |
123 | elseif placeID == "" or string.find(placeID,"%a") or string.len(placeID) > 9 then | |
124 | printOutput("Invalid ID") | |
125 | return | |
126 | end | |
127 | print("Teleportation process to "..placeID.." has started on "..#game.Players:GetChildren() - 1 - #whitelistPlayers) | |
128 | if located then | |
129 | print("--=Teleporter Found, starting teleport=--") | |
130 | PID.Value = placeID | |
131 | if speedrun then | |
132 | LocatedTeleporter.swagtp.Disabled = true | |
133 | wait() | |
134 | LocatedTeleporter.swagtp.Disabled = false | |
135 | end | |
136 | for i,v in pairs(game.Players:GetPlayers()) do | |
137 | if v.Name ~= game.Players.LocalPlayer.Name and checkWhitelist(v.Name) then | |
138 | if RecursiveSearch(game.Players,v.Name) and RecursiveSearch(game.Workspace,v.Name) then | |
139 | printOutput("Attempting to teleport "..v.Name.." to "..placeID.."...") | |
140 | local playerBase = game.Workspace:FindFirstChild(v.Name) | |
141 | for i,v2 in pairs(playerBase:GetChildren()) do -- Masks the player | |
142 | if v2:isA("BasePart") then | |
143 | if RecursiveSearch(v2,"face") then | |
144 | v2.face:Destroy() | |
145 | end | |
146 | v2.Transparency = 1 | |
147 | elseif v:isA("Hat") then | |
148 | v2:Destroy() | |
149 | end | |
150 | end | |
151 | spawn(function() | |
152 | while wait() do | |
153 | if not game.Players:FindFirstChild(v.Name) then return end | |
154 | if game.Workspace:FindFirstChild(v.Name) then | |
155 | playerBase = game.Workspace:FindFirstChild(v.Name) | |
156 | if playerBase:FindFirstChild("Torso") and not speedrun then | |
157 | playerBase.HumanoidRootPart.CFrame = LocatedTeleporter.teleBeam1.CFrame | |
158 | else | |
159 | playerBase.HumanoidRootPart.CFrame = LocatedTeleporter.CFrame | |
160 | end | |
161 | end | |
162 | end | |
163 | printOutput("Teleported "..v.Name.." to "..placeID.." successfully.") | |
164 | end) | |
165 | end | |
166 | end | |
167 | end | |
168 | else | |
169 | printOutput("Teleporter Not Found") | |
170 | end | |
171 | end | |
172 | ||
173 | wait() | |
174 | printOutput("-==== Limited Placing Gui by Raspberry Pi loaded ===-") | |
175 | printOutput("Locating teleporter...") | |
176 | wait(0.5) | |
177 | locateTeleporter() | |
178 | if located then | |
179 | printOutput('Ready. Paste in a PlaceId and click "GO" to start placing.') | |
180 | if justGo then | |
181 | Place() | |
182 | end | |
183 | GoButton.Active = true | |
184 | GoButton.TextColor3 = Color3.new(1,1,1) | |
185 | GoButton.MouseButton1Down:connect(function() | |
186 | if AutoButton.enabled.Visible then return end | |
187 | Place() | |
188 | end) | |
189 | AutoButton.MouseButton1Down:connect(function() | |
190 | if AutoButton.enabled.Visible == false then | |
191 | AutoButton.enabled.Visible = true | |
192 | printOutput("Auto On.") | |
193 | else | |
194 | AutoButton.enabled.Visible = false | |
195 | printOutput("Auto Off.") | |
196 | end | |
197 | end) | |
198 | spawn(function() | |
199 | while wait(1) do | |
200 | if AutoButton.enabled.Visible == true then | |
201 | GoButton.Active = false | |
202 | GoButton.TextColor3 = Color3.new(160/255, 160/255, 160/255) | |
203 | Place() | |
204 | else | |
205 | GoButton.Active = true | |
206 | GoButton.TextColor3 = Color3.new(1,1,1) | |
207 | end | |
208 | end | |
209 | end) | |
210 | end |