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