SHOW:
|
|
- or go back to the newest paste.
1 | --[[ | |
2 | Prometheus by Coolboyok11 | |
3 | ||
4 | This is the last roblox administrative tablet I will working on. Heavily dependant on its child | |
5 | modules, thus why it is more open-sourced than it's secret predecessor Odin. | |
6 | ||
7 | Ideas for v2 : | |
8 | --Module Loading | |
9 | --Design Types | |
10 | --SHA Check. | |
11 | --Secured Script Loading | |
12 | --Plugins | |
13 | --Auto dissmiss toggle | |
14 | --Playlists | |
15 | --Internal Browser | |
16 | ]] | |
17 | ||
18 | Core={ | |
19 | Players={ | |
20 | ["Coolboyok11"]={ --//Please leave this here. You don't have to though :P | |
21 | - | Name="Coolboyok11"; |
21 | + | Name="personsadminlol"; |
22 | Settings={ | |
23 | BetKey="!"; | |
24 | AutoDismiss=false; | |
25 | }; | |
26 | Data={ | |
27 | Tablets={}; | |
28 | Colour="Toothpaste"; | |
29 | }; | |
30 | Rank=7; | |
31 | }; | |
32 | ["LordRevorius"]={ | |
33 | Name="LordRevorius"; | |
34 | Settings={ | |
35 | BetKey="!"; | |
36 | AutoDismiss=false; | |
37 | }; | |
38 | Data={ | |
39 | Tablets={}; | |
40 | Colour="Really black"; | |
41 | }; | |
42 | Rank=6; | |
43 | }; | |
44 | ["Player"]={--For studio testing. | |
45 | Name="Player"; | |
46 | Settings={ | |
47 | BetKey="!"; | |
48 | AutoDismiss=false; | |
49 | }; | |
50 | Data={ | |
51 | Tablets={}; | |
52 | Colour="Really black"; | |
53 | }; | |
54 | Rank=7; | |
55 | }; | |
56 | }; | |
57 | BetKeys={ | |
58 | "!"; | |
59 | "$"; | |
60 | ";"; | |
61 | "}"; | |
62 | "."; | |
63 | ":"; | |
64 | "^"; | |
65 | }; | |
66 | Threads = { | |
67 | ||
68 | }; | |
69 | LocalScripts = { | |
70 | ||
71 | }; | |
72 | ThreadManager = { | |
73 | ["StatusThread"]=function(Thread) | |
74 | local ThreadActive = coroutine.status(Thread); | |
75 | if ThreadActive == true then | |
76 | return {Running = true}; | |
77 | else | |
78 | return {Running = false}; | |
79 | end; | |
80 | end; | |
81 | ["RunThread"]=function(Thread,...) | |
82 | end; | |
83 | ["NewThread"]=function(ThreadName,Function,...) | |
84 | local Data = {...}; | |
85 | local Thread = coroutine.create(Function); | |
86 | ||
87 | return Thread; | |
88 | end; | |
89 | }; | |
90 | Data={ | |
91 | SongPlaying=nil; | |
92 | MainEnvironment=getfenv(); | |
93 | Fakes={ | |
94 | Shared={}; | |
95 | _G={}; | |
96 | }; | |
97 | }; | |
98 | Modules={}; | |
99 | Cloud={}; | |
100 | Settings={ | |
101 | DefaultBetKey="!"; | |
102 | DefaultColour="Bright green"; | |
103 | Owner=game:GetService("Players"):FindFirstChild("Coolboyok11"); --//Your name here! | |
104 | }; | |
105 | Ranks={ | |
106 | [1]="Guest"; | |
107 | [2]="User"; | |
108 | [3]="Elavated User"; | |
109 | [4]="Moderator"; | |
110 | [5]="Manager"; | |
111 | [6]="Developer"; | |
112 | [7]="Manager" | |
113 | }; | |
114 | Banned={ | |
115 | ||
116 | };--//Temporary till I feel like re-writing a PHP ranked but too fucking lazy.. | |
117 | ScriptSettings={}; | |
118 | Commands={}; | |
119 | FFlags={};--//For quick settings | |
120 | Logs={}; | |
121 | BanResponse={ | |
122 | "Free modeling"; | |
123 | "Banning me"; | |
124 | "Banning players"; | |
125 | "Kicking players"; | |
126 | "Annoying"; | |
127 | "Bad scripts"; | |
128 | "Idiot"; | |
129 | }; | |
130 | CoreFunctions={ | |
131 | AddLogItem=function(Type,Message) | |
132 | local New=table.insert(Core.Logs,{Enum=Type,Message=Message}); | |
133 | return New; | |
134 | end; | |
135 | UpdateBanTable=function() | |
136 | --Yay Ban Methods... | |
137 | return Core.Banned; | |
138 | end; | |
139 | }; | |
140 | Services={ | |
141 | Http=game:GetService("HttpService"); | |
142 | HttpGet=function(Link,Cache) | |
143 | local Query=game:GetService("HttpService"):GetAsync(tostring(Link),Cache); | |
144 | Core.CoreFunctions.AddLogItem("HttpGet",Query); | |
145 | return Query; | |
146 | end; | |
147 | HttpPost=function(Link,Data,Encode) | |
148 | local Query=game:GetService("HttpService"):PostAsync(tostring(Link),Data,Encode) | |
149 | Core.CoreFunctions.AddLogItem("HttpPost",Query); | |
150 | return Query; | |
151 | end; | |
152 | JSONEncode=function(Data) | |
153 | return game:GetService("HttpService"):JSONEncode(Data); | |
154 | end; | |
155 | JSONDecode=function(Data) | |
156 | return game:GetService("HttpService"):JSONDecode(Data); | |
157 | end; | |
158 | }; | |
159 | Network={ | |
160 | Router=Instance.new("BindableFunction",script); --//Connections from remotes :P | |
161 | }; | |
162 | Packets={ | |
163 | Ban=function(Player) | |
164 | --Another Ban Method | |
165 | Core.Packets.Kick(Player); | |
166 | end; | |
167 | BanR=function(Player,Reason) | |
168 | --Ban Method! | |
169 | end; | |
170 | Kick=function(Player) | |
171 | local Method,Error=pcall(function() Player:Kick() end); | |
172 | if not Method then | |
173 | local MethodTwo,SError=pcall(function() Instance.new("RemoteEvent", Player):FireClient(Player,{[string.rep("a",2e5+5)]="a"}) end) | |
174 | end; | |
175 | end; | |
176 | }; | |
177 | }; | |
178 | ||
179 | --[[Metatable works :P]]-- | |
180 | ||
181 | setmetatable(Core.Data.Fakes._G,{ | |
182 | __metatable = "Locked!"; | |
183 | }) | |
184 | ||
185 | setmetatable(Core.Data.Fakes.Shared,{ | |
186 | __metatable = "Locked!"; | |
187 | }) | |
188 | ||
189 | --script.Parent = game.ServerScriptService; | |
190 | Instance.new("Folder",script).Name="Songs" | |
191 | print("[Prometheus] Tables initialised!"); | |
192 | wait(Core.CoreFunctions.UpdateBanTable()); | |
193 | --//Quaternions + CLerp | |
194 | ||
195 | local function QuaternionFromCFrame(cf) | |
196 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components(); | |
197 | local trace = m00 + m11 + m22 if trace > 0 then | |
198 | local s = math.sqrt(1 + trace); | |
199 | local recip = 0.5/s; | |
200 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5; | |
201 | else | |
202 | local i = 0; | |
203 | if m11 > m00 then | |
204 | i = 1; | |
205 | end; | |
206 | if m22 > (i == 0 and m00 or m11) then | |
207 | i = 2 end if i == 0 then | |
208 | local s = math.sqrt(m00-m11-m22+1); | |
209 | local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip; | |
210 | elseif i == 1 then | |
211 | local s = math.sqrt(m11-m22-m00+1); | |
212 | local recip = 0.5/s; | |
213 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip ; | |
214 | elseif i == 2 then | |
215 | local s = math.sqrt(m22-m00-m11+1); | |
216 | local recip = 0.5/s; | |
217 | return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip; | |
218 | end; | |
219 | end; | |
220 | end; | |
221 | ||
222 | local function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
223 | local xs, ys, zs = x + x, y + y, z + z; | |
224 | local wx, wy, wz = w*xs, w*ys, w*zs; | |
225 | local xx = x*xs; | |
226 | local xy = x*ys; | |
227 | local xz = x*zs; | |
228 | local yy = y*ys; | |
229 | local yz = y*zs; | |
230 | local zz = z*zs; | |
231 | return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy)) | |
232 | end; | |
233 | ||
234 | local function QuaternionSlerp(a, b, t) | |
235 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]; | |
236 | local startInterp, finishInterp; | |
237 | if cosTheta >= 0.0001 then | |
238 | if (1 - cosTheta) > 0.0001 then | |
239 | local theta = math.acos(cosTheta); | |
240 | local invSinTheta = 1/math.sin(theta); | |
241 | startInterp = math.sin((1-t)*theta)*invSinTheta; | |
242 | finishInterp = math.sin(t*theta)*invSinTheta; | |
243 | else | |
244 | startInterp = 1-t finishInterp = t; | |
245 | end; | |
246 | else | |
247 | if (1+cosTheta) > 0.0001 then | |
248 | local theta = math.acos(-cosTheta); | |
249 | local invSinTheta = 1/math.sin(theta); | |
250 | startInterp = math.sin((t-1)*theta)*invSinTheta; | |
251 | finishInterp = math.sin(t*theta)*invSinTheta; | |
252 | else startInterp = t-1 finishInterp = t; | |
253 | end; | |
254 | end; | |
255 | return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp; | |
256 | end; | |
257 | ||
258 | function CLerp(a,b,t) | |
259 | local qa={QuaternionFromCFrame(a)}; | |
260 | local qb={QuaternionFromCFrame(b)}; | |
261 | local ax,ay,az=a.x,a.y,a.z; | |
262 | local bx,by,bz=b.x,b.y,b.z; | |
263 | local _t=1-t; | |
264 | return QuaternionToCFrame(_t*ax+t*bx,_t*ay+t*by,_t*az+t*bz,QuaternionSlerp(qa, qb, t)); | |
265 | end | |
266 | ||
267 | --//Part Assertion | |
268 | local function AddPart(Text,Colour,Player,Function) | |
269 | if Colour==nil then | |
270 | Colour='White'; | |
271 | end; | |
272 | if not Player or type(Player) ~= "userdata" then | |
273 | return; | |
274 | end; | |
275 | local Adorn=game.Workspace:FindFirstChild(Player.Name) and game.Workspace[Player.Name]:FindFirstChild("Torso") and game.Workspace[Player.Name].Torso:IsA("Part") and game.Workspace[Player.Name].Torso.CFrame + Vector3.new(0,6,0) or CFrame.new(0,10,0); | |
276 | if Player.Character == nil then | |
277 | if script:FindFirstChild(Player.Name) == nil then | |
278 | local SpacePart = Instance.new("Part",script); | |
279 | SpacePart.Name = Player.Name; | |
280 | SpacePart.Transparency = 1; | |
281 | SpacePart.Anchored = true; | |
282 | SpacePart.CanCollide = false; | |
283 | SpacePart.CFrame = CFrame.new(0,1,0); | |
284 | Adorn = SpacePart.CFrame + Vector3.new(0,6,0) or CFrame.new(0,10,0); | |
285 | elseif script:FindFirstChild(Player.Name) ~= nil then | |
286 | -- | |
287 | end; | |
288 | end; | |
289 | local Part=Instance.new("Part",script); | |
290 | Part.CanCollide=false; | |
291 | Part.Anchored=true; | |
292 | Part.FormFactor="Custom"; | |
293 | Part.Size=Vector3.new(2,2,2); | |
294 | Part.CFrame=CFrame.new(Adorn.p); | |
295 | Part.BackSurface="SmoothNoOutlines"; | |
296 | Part.BottomSurface="SmoothNoOutlines"; | |
297 | Part.FrontSurface="SmoothNoOutlines"; | |
298 | Part.LeftSurface="SmoothNoOutlines"; | |
299 | Part.RightSurface="SmoothNoOutlines"; | |
300 | Part.TopSurface="SmoothNoOutlines"; | |
301 | Part.Locked=true; | |
302 | local SelectionFrame=Instance.new("SelectionBox",Part); | |
303 | SelectionFrame.Adornee=Part; | |
304 | if Colour=="Random" then | |
305 | SelectionFrame.Color=BrickColor.Random(); | |
306 | else | |
307 | SelectionFrame.Color=BrickColor.new(Colour); | |
308 | end; | |
309 | Part.BrickColor=SelectionFrame.Color; | |
310 | SelectionFrame.Transparency=0.8; | |
311 | local Light=Instance.new("PointLight",Part); | |
312 | Light.Color=BrickColor.new(Colour).Color; | |
313 | Light.Brightness=100; | |
314 | Light.Range=10; | |
315 | Light.Shadows=true; | |
316 | Light.Enabled=true; | |
317 | local BillboardGui=Instance.new("BillboardGui",Part); | |
318 | BillboardGui.Adornee=Part; | |
319 | --BillboardGui.AlwaysOnTop=false; | |
320 | BillboardGui.StudsOffset=Vector3.new(0,1,0); | |
321 | BillboardGui.Size=UDim2.new(3, 0, 3, 0); | |
322 | local TextL=Instance.new("TextLabel",BillboardGui); | |
323 | TextL.Text=Text; | |
324 | TextL.BackgroundTransparency=1; | |
325 | TextL.Size=UDim2.new(1, 0, 0.5, 0); | |
326 | TextL.FontSize="Size18"; | |
327 | TextL.Font="SourceSansBold"; | |
328 | TextL.TextColor3=BrickColor.new("White").Color; | |
329 | TextL.TextStrokeTransparency=0.2; | |
330 | local TextLabelColor=BrickColor.new(Colour); | |
331 | TextL.TextStrokeColor3=SelectionFrame.Color.Color; | |
332 | table.insert(Core.Players[Player.Name].Data.Tablets,Part); | |
333 | local ClickEvent=Instance.new("ClickDetector",Part); | |
334 | ClickEvent.MaxActivationDistance=math.huge;--To make sure even if player is nil :P | |
335 | ClickEvent.MouseHoverEnter:connect(function(PlayerE) | |
336 | if PlayerE.Name==Player.Name then | |
337 | for i=1,4 do | |
338 | game:GetService("RunService").Heartbeat:wait() | |
339 | Part.Size=Vector3.new(Part.Size.X+0.1,Part.Size.Y+0.1,Part.Size.Z+0.1); | |
340 | end; | |
341 | end; | |
342 | end); | |
343 | ClickEvent.MouseHoverLeave:connect(function(PlayerE) | |
344 | if PlayerE.Name==Player.Name then | |
345 | for i=1,4 do | |
346 | game:GetService("RunService").Heartbeat:wait() | |
347 | Part.Size=Vector3.new(Part.Size.X-0.1,Part.Size.Y-0.1,Part.Size.Z-0.1); | |
348 | end; | |
349 | end; | |
350 | end); | |
351 | ClickEvent.MouseClick:connect(function(PlayerE) | |
352 | if PlayerE.Name==Player.Name then | |
353 | if Function==nil then | |
354 | repeat | |
355 | game:GetService("RunService").Heartbeat:wait() | |
356 | Part.Size=Vector3.new(Part.Size.X-0.1,Part.Size.Y-0.1,Part.Size.Z-0.1); | |
357 | until Part.Size.X<0.3; | |
358 | Part:Destroy(); | |
359 | for i,v in pairs(Core.Players[Player.Name].Data.Tablets) do | |
360 | if v==Part then | |
361 | table.remove(Core.Players[Player.Name].Data.Tablets,i); | |
362 | end; | |
363 | end; | |
364 | else | |
365 | local Success,Error=ypcall(function() | |
366 | Function(); | |
367 | end); | |
368 | if Error then | |
369 | print("[AddPart Function Error] "..tostring(Error));--//Later on there will be a better debug method! | |
370 | end; | |
371 | end; | |
372 | end; | |
373 | end); | |
374 | if (Core.Players[Player.Name].Settings.AutoDismiss == true and Function == nil) then | |
375 | local InternalThread = coroutine.create(function() | |
376 | wait(4); | |
377 | repeat | |
378 | game:GetService("RunService").Heartbeat:wait() | |
379 | Part.Size=Vector3.new(Part.Size.X-0.1,Part.Size.Y-0.1,Part.Size.Z-0.1); | |
380 | until Part.Size.X<0.3; | |
381 | Part:Destroy(); | |
382 | for i,v in pairs(Core.Players[Player.Name].Data.Tablets) do | |
383 | if v==Part then | |
384 | table.remove(Core.Players[Player.Name].Data.Tablets,i); | |
385 | end; | |
386 | end; | |
387 | end); | |
388 | coroutine.resume(InternalThread); | |
389 | end; | |
390 | end; | |
391 | ||
392 | --//Rotation | |
393 | spawn(function() | |
394 | local Number=1; | |
395 | local Player=nil; | |
396 | game:GetService("RunService").Heartbeat:connect(function() | |
397 | Number=Number+0.0025; | |
398 | for i,v in pairs(game.Players:GetPlayers()) do | |
399 | for a,b in pairs(Core.Players) do | |
400 | if v.Name==b.Name then | |
401 | Player=v; | |
402 | for i=1,#b.Data.Tablets do | |
403 | if Player.Character and Player.Name and Player.Character:FindFirstChild("Torso") then | |
404 | if Player.Character.Parent==game.Workspace then | |
405 | local Parts=Core.Players[Player.Name].Data.Tablets; | |
406 | local Part=Parts[i]; | |
407 | Part.CFrame=CLerp(Part.CFrame,CFrame.new(game.Workspace[v.Name].Torso.CFrame.p) | |
408 | *CFrame.Angles(0,math.rad((360/#Parts)*i)+Number,0) | |
409 | *CFrame.new(3+#Parts,math.sin((tick()+i)*5)/1.5,0) | |
410 | *CFrame.Angles(0,math.rad(90),0) | |
411 | *CFrame.Angles(math.sin((tick()+i)*5)/2,math.sin((tick()+i)*5)/2,math.sin((tick()+i)*5)/2) | |
412 | ,.1); | |
413 | end; | |
414 | elseif script:FindFirstChild(Player.Name) then | |
415 | local Parts=Core.Players[Player.Name].Data.Tablets; | |
416 | local Part=Parts[i]; | |
417 | Part.CFrame=CLerp(Part.CFrame,CFrame.new(script:FindFirstChild(Player.Name).CFrame.p) | |
418 | *CFrame.Angles(0,math.rad((360/#Parts)*i)+Number,0) | |
419 | *CFrame.new(3+#Parts,math.sin((tick()+i)*5)/1.5,0) | |
420 | *CFrame.Angles(0,math.rad(90),0) | |
421 | *CFrame.Angles(math.sin((tick()+i)*5)/2,math.sin((tick()+i)*5)/2,math.sin((tick()+i)*5)/2) | |
422 | ,.1); | |
423 | end; | |
424 | end; | |
425 | end; | |
426 | end; | |
427 | end; | |
428 | end); | |
429 | end); | |
430 | ||
431 | function DestroyTablets(Player) | |
432 | --if not Player or type(Player) ~= "userdata" then return end; | |
433 | pcall(function() | |
434 | for i,v in pairs(Core.Players[Player.Name].Data.Tablets) do | |
435 | local Thread=coroutine.create(function() | |
436 | repeat | |
437 | game:GetService("RunService").Heartbeat:wait() | |
438 | v.Size=Vector3.new(v.Size.X-0.1,v.Size.Y-0.1,v.Size.Z-0.1); | |
439 | until v.Size.X<0.3; | |
440 | v:Destroy(); | |
441 | end) | |
442 | coroutine.resume(Thread)----table.remove(Core.Players[Player.Name].Data.Tablets,i); | |
443 | end; | |
444 | Core.Players[Player.Name].Data.Tablets={}; | |
445 | end) | |
446 | end; | |
447 | ||
448 | function FindPlayer(Player) | |
449 | local Player=tostring(Player) | |
450 | for i,v in pairs(game.Players:GetPlayers()) do | |
451 | local Name=string.lower(string.sub(v.Name,1,string.len(Player))); | |
452 | if Name==Player then | |
453 | return v; | |
454 | end; | |
455 | end; | |
456 | end; | |
457 | ||
458 | function CheckBanned(Player) | |
459 | local Banned=false; | |
460 | if Core.Players[Player.Name] == nil then return {Banned=false}; end; | |
461 | if Core.Players[Player.Name].Rank < 0 then | |
462 | return {Banned=true}; | |
463 | else | |
464 | return {Banned=false}; | |
465 | end; | |
466 | end; | |
467 | ||
468 | function ConnectPlayer(Player) | |
469 | table.foreach(Core.Banned,function(Index,Table) | |
470 | if Table.Username==Player.Name then | |
471 | Alert(Player.Name.." was kicked for a persisting ban! Reason : "..Table.Reason); | |
472 | return Core.Packets.Kick(Player); | |
473 | end; | |
474 | end) | |
475 | --if CheckBanned(Player).Banned==true then | |
476 | --Core.Packets.Kick(Player); | |
477 | --end; | |
478 | if Core.Players[Player.Name] == nil then | |
479 | Core.Players[Player.Name]={Name=Player.Name;Rank=1;Data={Tablets={};Colour=Core.Settings.DefaultColour};Settings={BetKey="!"}}; | |
480 | Player.Chatted:connect(function(Message) | |
481 | OnChatted(Message,Player); | |
482 | end); | |
483 | AddPart("[Prometheus]\nVersion 1.0",'Really red',Player,nil); | |
484 | else | |
485 | Player.Chatted:connect(function(Message) | |
486 | OnChatted(Message,Player); | |
487 | end); | |
488 | AddPart("[Prometheus]\nWelcome back "..Player.Name.."!","Random",Player,nil); | |
489 | end; | |
490 | end; | |
491 | ||
492 | function Alert(Message) | |
493 | for i,v in pairs(Core.Players) do | |
494 | if v.Rank >= 5 then | |
495 | if game.Players:FindFirstChild(v.Name) then | |
496 | AddPart(Message,v.Data.Colour,game.Players[v.Name],nil); | |
497 | end; | |
498 | end; | |
499 | end; | |
500 | end; | |
501 | ||
502 | --//Chatted Function | |
503 | function OnChatted(Message,Player) | |
504 | if not Message or type(Message) ~= "string" then | |
505 | return; | |
506 | end; | |
507 | if not Player or type(Player) ~= "userdata" then | |
508 | return; | |
509 | end; | |
510 | Message=Message:gsub("/e ",""); | |
511 | local InTCheck=(Message:sub(1,1)==Core.Players[Player.Name].Settings.BetKey); | |
512 | if InTCheck then | |
513 | Message=Message:sub(2); | |
514 | local SpaceDet=Message:find(" "); | |
515 | local SubString,ProString; | |
516 | pcall(function() | |
517 | SubString=Message:sub(1,SpaceDet-1); | |
518 | ProString=Message:sub(SpaceDet+1); | |
519 | end) | |
520 | if not SubString then | |
521 | SubString=Message; | |
522 | end; | |
523 | if not ProString then | |
524 | ProString=""; | |
525 | end; | |
526 | local Profile=Core.Players[Player.Name]; | |
527 | for i,v in pairs(Core.Commands) do | |
528 | table.foreach(v.Calls,function(self,index) | |
529 | if SubString==index and Profile.Rank then | |
530 | if v.Rank <= Profile.Rank then | |
531 | local CCFlags={}; | |
532 | for a,s in pairs(v.Flags) do | |
533 | if string.find(ProString,("-"..s)) ~= nil then | |
534 | --table.insert(CCFlags,s); | |
535 | local FlagData; | |
536 | local Test,Error=pcall(function() | |
537 | string.sub(ProString,string.find(ProString,("-"..s)),string.sub(ProString,string.find(ProString:sub(string.find(ProString,("-"..s))+1),"-"))); | |
538 | end) | |
539 | if not Test then | |
540 | FlagData=ProString; | |
541 | else | |
542 | FlagData=string.sub(ProString,string.find(ProString,("-"..s)),string.sub(ProString,string.find(ProString:sub(string.find(ProString,("-"..s))+1),"-"))); | |
543 | end | |
544 | FlagData=string.gsub(FlagData,("-"..s),"",1); | |
545 | CCFlags[s]={FlagData}; | |
546 | ProString=string.gsub(ProString,("-"..s),"",1); | |
547 | end; | |
548 | end; | |
549 | local Thread=coroutine.create(v.Function); | |
550 | local Success,Error=coroutine.resume(Thread,ProString,CCFlags,Player,Profile.Rank); | |
551 | if not Success then | |
552 | print("[OnChatted Error] "..tostring(Error)); | |
553 | end; | |
554 | else | |
555 | AddPart("Your rank is too low to access this command. Required Rank : "..v.Rank,"Really red",Player,nil); | |
556 | end; | |
557 | end; | |
558 | end); | |
559 | end; | |
560 | end; | |
561 | end; | |
562 | ||
563 | function NewCommand(Name,Desc,Rank,Calls,Flags,Func) | |
564 | Core.Commands[Name]={Name=Name,Desc=Desc,Rank=Rank,Calls=Calls,Flags=Flags,Function=Func} | |
565 | end; | |
566 | ||
567 | NewCommand("Ping","Pings a tablet to speaker",1,{'ping'},{"all","plr"},function(Message,Flags,Player,PlayerRank) | |
568 | function ParseTest(Text,PlayerSent,PlayerToSend) | |
569 | local TEXTS = { | |
570 | ["%PLAYER%"] = PlayerToSend.Name; | |
571 | ["%OWNER%"] = PlayerSent.Name; | |
572 | ["%AGE%"] = PlayerToSend.AccountAge; | |
573 | ["%RANK%"] = Core.Players[PlayerToSend.Name].Rank; | |
574 | }; | |
575 | local Text = tostring(Text); | |
576 | print(Text) | |
577 | for i,v in pairs(TEXTS) do | |
578 | if string.find(Text,tostring(i)) then | |
579 | print(i,v) | |
580 | string.gsub(Text,tostring(i),tostring(v)); | |
581 | end; | |
582 | end; | |
583 | print(Text) | |
584 | return Text; | |
585 | end; | |
586 | ||
587 | if Message == "" then return end; | |
588 | pcall(function() | |
589 | if Flags["all"] then | |
590 | if PlayerRank > 4 then | |
591 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do | |
592 | --ParseTest(Flags["all"][1],Player,v) | |
593 | AddPart(Flags["all"][1],'Random',v,nil); | |
594 | end; | |
595 | else | |
596 | AddPart("Your rank is too low.",'Really red',v,nil); | |
597 | end; | |
598 | end; | |
599 | if Flags["plr"] then | |
600 | local Find = string.find(Flags["plr"][1]:sub(2)," "); | |
601 | local PlayerS = string.sub(Flags["plr"][1]:sub(2),1,Find-1); | |
602 | local MSG = string.sub(Flags["plr"][1]:sub(2),Find+1); | |
603 | local Selected=FindPlayer(PlayerS); | |
604 | if Selected == nil then | |
605 | return AddPart("No player found.","Really red",Player,nil); | |
606 | end; | |
607 | --MSG = ParseMessage(tostring(MSG),Player,Selected) | |
608 | AddPart(MSG,"Random",Selected,nil); | |
609 | end; | |
610 | if next(Flags) == nil then | |
611 | AddPart(tostring(Message),'Random',Player,nil); | |
612 | ParseMessage(tostring(Message),Player,Player) | |
613 | end; | |
614 | end); | |
615 | end); | |
616 | ||
617 | NewCommand("Networked Players","Gets all players, network or not.",7,{'net'},{},function(Message,Flags,Player,PlayerRank) | |
618 | if msg == "" then return end; | |
619 | pcall(function() | |
620 | if next(Flags) == nil then | |
621 | wait(DestroyTablets(Player)); | |
622 | for i,v in ipairs(game:FindService("NetworkServer"):GetChildren()) do | |
623 | local Players=v:GetPlayer(); | |
624 | if(not Players.Parent) then | |
625 | AddPart(Players.Name.." | NIL",Core.Players[Player.Name].Data.Colour,Player,function() | |
626 | wait(DestroyTablets(Player)); | |
627 | AddPart("Disconnect","Really red",Player,function() | |
628 | wait(DestroyTablets(Player)); | |
629 | Core.Packets.Kick(Players); | |
630 | end) | |
631 | end); | |
632 | else | |
633 | AddPart(Players.Name.." | Players",Core.Players[Player.Name].Data.Colour,Player,nil); | |
634 | end; | |
635 | end; | |
636 | end; | |
637 | end); | |
638 | end); | |
639 | ||
640 | NewCommand("Music","The scripts music player, self explanatory.",4,{"m","music","song"},{"name","stop"},function(Message,Flags,Player,PlayerRank) | |
641 | local RbxGui = assert(LoadLibrary("RbxGui")); | |
642 | pcall(function() | |
643 | if Flags["name"] then | |
644 | local Name=Flags["name"][1]:sub(2); | |
645 | local Http=Core.Services.Http; | |
646 | local Query="http://roproxy.tk/catalog/json?Keyword="..tostring(Name).."&Category=9&ResultsPerPage=20"; | |
647 | local Assets=Http:JSONDecode(Http:GetAsync(Query)); | |
648 | function List(Player) | |
649 | wait(DestroyTablets(Player)); | |
650 | for i=1,#Assets do | |
651 | AddPart("Name : "..Assets[i].Name,Core.Players[Player.Name].Data.Colour,Player,function() | |
652 | wait(DestroyTablets(Player)); | |
653 | AddPart("Name : "..Assets[i].Name,Core.Players[Player.Name].Data.Colour,Player,function() end); | |
654 | AddPart('Publisher: '..Assets[i].Creator,Core.Players[Player.Name].Data.Colour,Player,function() end); | |
655 | AddPart('Play song','Lime green',Player,function() | |
656 | if Core.Data.SongPlaying ~= nil then | |
657 | DestroyTablets(Player); | |
658 | AddPart("A song is already playing : "..Core.Data.SongPlaying.Name..". Would you like to stop it?",Core.Players[Player.Name].Data.Colour,Player,function() end); | |
659 | AddPart("Yes","Bright green",Player,function() | |
660 | DestroyTablets(Player); | |
661 | local Song=script.Songs:FindFirstChild(tostring(Core.Data.SongPlaying.ID)); | |
662 | wait(Song:Stop()); | |
663 | Song:Destroy(); | |
664 | local NewSong=Instance.new("Sound",script.Songs); | |
665 | NewSong.SoundId="rbxassetid://"..Assets[i].AssetId; | |
666 | NewSong.PlayOnRemove=false; | |
667 | NewSong.Looped=false; | |
668 | NewSong:Play(); | |
669 | NewSong.Name=Assets[i].AssetId; | |
670 | Core.Data.SongPlaying={ID=Assets[i].AssetId,Name=Assets[i].Name}; | |
671 | function Pause() | |
672 | wait(DestroyTablets(Player)); | |
673 | AddPart("Now playing : "..Assets[i].Name,Core.Players[Player.Name].Data.Colour,Player,function() end); | |
674 | AddPart("Stop","Really red",Player,function() | |
675 | DestroyTablets(Player); | |
676 | wait(NewSong:Stop()); | |
677 | NewSong:Destroy(); | |
678 | AddPart("Song stopped","Really red",Player,nil); | |
679 | end) | |
680 | AddPart("Pause","Bright orange",Player,function() | |
681 | DestroyTablets(Player); | |
682 | NewSong:Pause(); | |
683 | AddPart("Song paused","Bright blue",Player,function() end); | |
684 | AddPart("Play","Lime green",Player,function() | |
685 | DestroyTablets(Player) | |
686 | NewSong:Play(); | |
687 | AddPart("Playing "..Assets[i].Name,"Bright blue",Player,function() end); | |
688 | Pause() | |
689 | end); | |
690 | end) | |
691 | AddPart("Back","Bright blue",Player,function() | |
692 | DestroyTablets(Player); | |
693 | List(Player); | |
694 | AddPart("Back to current song","Bright blue",Player,function() | |
695 | Pause(); | |
696 | end); | |
697 | end) | |
698 | end; | |
699 | Pause(); | |
700 | end); | |
701 | AddPart("No","Bright red",Player,function() | |
702 | Pause(); | |
703 | end); | |
704 | else | |
705 | wait(DestroyTablets(Player)); | |
706 | local NewSong=Instance.new("Sound",script.Songs); | |
707 | NewSong.SoundId="rbxassetid://"..Assets[i].AssetId; | |
708 | NewSong.PlayOnRemove=false; | |
709 | NewSong.Looped=false; | |
710 | NewSong:Play(); | |
711 | NewSong.Name=Assets[i].AssetId; | |
712 | Core.Data.SongPlaying={ID=Assets[i].AssetId,Name=Assets[i].Name}; | |
713 | function Pauses() | |
714 | wait(DestroyTablets(Player)); | |
715 | AddPart("Now playing : "..Assets[i].Name,Core.Players[Player.Name].Data.Colour,Player,function() end); | |
716 | AddPart("Stop","Really red",Player,function() | |
717 | DestroyTablets(Player); | |
718 | wait(NewSong:Stop()); | |
719 | NewSong:Destroy(); | |
720 | AddPart("Song stopped","Really red",Player,nil); | |
721 | end) | |
722 | AddPart("Pause","Bright orange",Player,function() | |
723 | DestroyTablets(Player); | |
724 | NewSong:Pause(); | |
725 | AddPart("Song paused","Bright blue",Player,function() end); | |
726 | AddPart("Play","Lime green",Player,function() | |
727 | DestroyTablets(Player) | |
728 | AddPart("Playing "..Assets[i].Name,"Bright blue",Player,function() end); | |
729 | NewSong:Play(); | |
730 | Pauses(); | |
731 | end); | |
732 | end); | |
733 | AddPart("Back","Bright blue",Player,function() | |
734 | DestroyTablets(Player); | |
735 | List(Player); | |
736 | AddPart("Back to current song","Bright blue",Player,function() | |
737 | Pauses(); | |
738 | end); | |
739 | end) | |
740 | end; | |
741 | Pauses(); | |
742 | end; | |
743 | end); | |
744 | end); | |
745 | end; | |
746 | end; | |
747 | List(Player); | |
748 | end; | |
749 | if Flags["stop"] then | |
750 | for i,v in pairs(script.Songs:GetChildren()) do | |
751 | wait(v:Stop()); | |
752 | v:Destroy(); | |
753 | end; | |
754 | AddPart("Stopped all songs!","Really red",Player,nil); | |
755 | Core.Data.SongPlaying=nil; | |
756 | end; | |
757 | if next(Flags) == nil then | |
758 | AddPart("No name selected!",'Random',Player,nil); | |
759 | end; | |
760 | end) | |
761 | end); | |
762 | ||
763 | NewCommand("Kill","Kills <player/all>",2,{"kill"},{"plr","all"},function(Message,Flags,Player,PlayerRank) | |
764 | pcall(function() | |
765 | if Flags["all"] then | |
766 | if PlayerRank > 4 then | |
767 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do | |
768 | v.Character:BreakJoints() | |
769 | end; | |
770 | else | |
771 | AddPart("Your rank is too low. Require : 4",'Really red',v,nil); | |
772 | end; | |
773 | end; | |
774 | if Flags["plr"] then | |
775 | local Selected=FindPlayer(Flags["plr"][1]:sub(2)); | |
776 | Selected.Character:BreakJoints(); | |
777 | end; | |
778 | if next(Flags) == nil then | |
779 | AddPart("No player selected!","Really red",Player,nil); | |
780 | end; | |
781 | end); | |
782 | end); | |
783 | ||
784 | NewCommand("Forcefield","Adds a forcefield to <player/all>",2,{"ff"},{"plr","all"},function(Message,Flags,Player,PlayerRank) | |
785 | pcall(function() | |
786 | if Flags["all"] then | |
787 | if PlayerRank > 4 then | |
788 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do | |
789 | Instance.new("ForceField",v.Character) | |
790 | end; | |
791 | else | |
792 | AddPart("Your rank is too low. Require : 4",'Really red',v,nil); | |
793 | end; | |
794 | end; | |
795 | if Flags["plr"] then | |
796 | local Selected=FindPlayer(Flags["plr"][1]:sub(2)); | |
797 | Instance.new("ForceField",Selected.Character) | |
798 | end; | |
799 | if next(Flags) == nil then | |
800 | AddPart("No player selected!","Really red",Player,nil); | |
801 | end; | |
802 | end); | |
803 | end); | |
804 | ||
805 | NewCommand("Respawn","Respawns <player/all>",2,{"respawn","rs"},{"plr","all"},function(Message,Flags,Player,PlayerRank) | |
806 | pcall(function() | |
807 | if Flags["all"] then | |
808 | if PlayerRank > 4 then | |
809 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do | |
810 | v:LoadCharacter(); | |
811 | end; | |
812 | else | |
813 | AddPart("Your rank is too low. Require : 4",'Really red',v,nil); | |
814 | end; | |
815 | end; | |
816 | if Flags["plr"] then | |
817 | local Selected=FindPlayer(Flags["plr"][1]:sub(2)); | |
818 | Selected:LoadCharacter(); | |
819 | end; | |
820 | if next(Flags) == nil then | |
821 | AddPart("No player selected!","Really red",Player,nil); | |
822 | end; | |
823 | end); | |
824 | end); | |
825 | ||
826 | NewCommand("Kick","Kicks <player/all>",6,{"kick"},{"plr","all"},function(Message,Flags,Player,PlayerRank) | |
827 | pcall(function() | |
828 | if Flags["all"] then | |
829 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do | |
830 | Core.Packets.Kick(v); | |
831 | end; | |
832 | end; | |
833 | if Flags["plr"] then | |
834 | local Selected=FindPlayer(Flags["plr"][1]:sub(2)); | |
835 | Core.Packets.Kick(Selected); | |
836 | end; | |
837 | if next(Flags) == nil then | |
838 | AddPart("No player selected!","Really red",Player,nil); | |
839 | end; | |
840 | end); | |
841 | end); | |
842 | ||
843 | NewCommand("Bans","Lists all banned players",4,{"b","bans"},{"plr"},function(Message,Flags,Player,PlayerRank) | |
844 | wait(DestroyTablets(Player)); | |
845 | table.foreach(Core.Banned,function(Index,PlayerTable) | |
846 | AddPart(PlayerTable.Username,"Really red",Player,function() | |
847 | wait(DestroyTablets(Player)); | |
848 | table.foreach(PlayerTable,function(Name,Value) | |
849 | AddPart(Name.." : "..Value,"Really red",Player,nil); | |
850 | AddPart("Unban player?","Bright green",Player,function() | |
851 | DestroyTablets(Player); | |
852 | AddPart("Unbanned "..PlayerTable.Name,"Bright green",Player,nil); | |
853 | PlayerTable = nil; | |
854 | end); --//Only if it's local. | |
855 | end) | |
856 | end); | |
857 | end) | |
858 | end); | |
859 | ||
860 | NewCommand("Website Flag","Allows quick write/read",7,{"web"},{"update"},function(Message,Flags,Player,PlayerRank) | |
861 | if Flags["update"] then | |
862 | local Success,Error=pcall(function() Core.CoreFunctions.UpdateBanTable() end) | |
863 | if not Success then | |
864 | return AddPart("There was an error while updating!","Bright red",Player,nil); | |
865 | end; | |
866 | AddPart("Successfully updated databases!","Bright green",Player,nil); | |
867 | end; | |
868 | end); | |
869 | ||
870 | NewCommand("Modules","Modules Management",7,{"modules"},{"load"},function(Message,Flags,Player,PlayerRank) | |
871 | if Flags["load"] then | |
872 | --return AddPart("Load not implemented yet!","Really red",Player,nil); | |
873 | local ScriptLoad,Error = ypcall(function() game:GetService("HttpService"):GetAsync(Flags["load"][1]:sub(2)) end); | |
874 | if not ScriptLoad then | |
875 | return AddPart("There was an error while loading this module.","Really red",Player,nil); | |
876 | --return AddPart("Load not implemented yet!","Really red",Player,nil); | |
877 | else | |
878 | --ScriptLoad = game:GetService("HttpService"):GetAsync(Flags["load"][1]:sub(2)); | |
879 | return AddPart("Load not implemented yet!","Really red",Player,nil); | |
880 | end; | |
881 | if string.find(ScriptLoad,"--promsig%93aa8c4f1d11ecc46edd0e0aee91f8ef72e9a078771d162d4c2202eada455a28") ~= nil then | |
882 | local Thread,Error = coroutine.create(function() | |
883 | local Success,Fail = loadstring(ScriptLoad,[[ModuleService]])(); | |
884 | if not Success then | |
885 | AddPart("[Prometheus Module System]\n"..Fail,"Really red",Player,nil); | |
886 | end; | |
887 | end) | |
888 | coroutine.resume(Thread) | |
889 | else | |
890 | return AddPart("Security Check Failed!","Really red",Player,nil); | |
891 | end; | |
892 | end; | |
893 | if Flags["stop"] then | |
894 | coroutine.yield(Core.Modules[Flags["stop"]:sub(2)].Thread) --Attempt to stop the thread | |
895 | Core.Modules[Flags["stop"]:sub(2)].Kill = true; --Hit the trains brakes! | |
896 | Core.ThreadManager.StatusThread(Core.Modules[Flags["stop"]:sub(2)].Thread) | |
897 | end; | |
898 | if next(Flags) == nil then | |
899 | DestroyTablets(Player) | |
900 | return AddPart("Load not implemented yet!","Really red",Player,nil); | |
901 | end; | |
902 | end); | |
903 | ||
904 | NewCommand("Destroy Tablets","Destroys your tablets",1,{'dt'},{"all","plr"},function(Message,Flags,Player,PlayerRank) | |
905 | pcall(function() | |
906 | if Flags["all"] then | |
907 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do | |
908 | DestroyTablets(v) | |
909 | end; | |
910 | end; | |
911 | if Flags["plr"] then | |
912 | local Players=FindPlayer(Flags["plr"][1]:sub(2)); | |
913 | DestroyTablets(Players); | |
914 | end; | |
915 | if next(Flags) == nil then | |
916 | DestroyTablets(Player) | |
917 | end; | |
918 | end); | |
919 | end); | |
920 | ||
921 | NewCommand("Players","Lists all players",5,{"plrs","players","plys","plyrs"},{"plr"},function(Message,Flags,Player,PlayerRank) | |
922 | pcall(function() | |
923 | if Flags["plr"] then | |
924 | local v=FindPlayer(Flags["plr"][1]:sub(2)); | |
925 | DestroyTablets(Player); | |
926 | if v==nil then | |
927 | return AddPart("Selected player was not found!","Really red",Player,nil); | |
928 | end; | |
929 | wait(DestroyTablets(Player)); | |
930 | AddPart("Name - "..v.Name,Core.Players[Player.Name].Data.Colour,Player,nil); | |
931 | AddPart("Age - "..v.AccountAge,Core.Players[Player.Name].Data.Colour,Player,nil); | |
932 | AddPart("BetKey - "..Core.Players[v.Name].Settings.BetKey,Core.Players[Player.Name].Data.Colour,Player,function() | |
933 | DestroyTablets(Player); | |
934 | table.foreach(Core.BetKeys,function(Index,Key) | |
935 | AddPart(Key,Core.Players[Player.Name].Data.Colour,Player,function() | |
936 | DestroyTablets(Player); | |
937 | Core.Players[v.Name].Settings.BetKey=Key; | |
938 | if Player ~= v then | |
939 | AddPart(v.Name.."'s bet key is now "..Key,Core.Players[Player.Name].Data.Colour,Player,nil); | |
940 | end; | |
941 | AddPart("Your bet key is now "..Key,Core.Players[v.Name].Data.Colour,v,nil); | |
942 | end) | |
943 | end) | |
944 | AddPart("Cancel","Bright red",Player,function() | |
945 | DestroyTablets(Player); | |
946 | end); | |
947 | end); | |
948 | AddPart("Colour - "..Core.Players[v.Name].Data.Colour,Core.Players[Player.Name].Data.Colour,Player,function() | |
949 | local Colours={"White","Bright red","Bright green","Bright blue","Bright yellow","Toothpaste","Pink","Black"}; | |
950 | DestroyTablets(Player); | |
951 | table.foreach(Colours,function(Index,Colour) | |
952 | AddPart(Colour,Colour,Player,function() | |
953 | DestroyTablets(Player); | |
954 | Core.Players[v.Name].Data.Colour=Colour; | |
955 | if Player ~= v then | |
956 | AddPart(v.Name.."'s default colour is now "..Colour,Core.Players[Player.Name].Data.Colour,Player,nil); | |
957 | end; | |
958 | AddPart("Your default colour is now "..Colour,Core.Players[v.Name].Data.Colour,v,nil); | |
959 | end); | |
960 | end); | |
961 | AddPart("Cancel","Bright red",Player,function() | |
962 | DestroyTablets(Player); | |
963 | end); | |
964 | end); | |
965 | AddPart("Rank - "..Core.Players[v.Name].Rank,Core.Players[Player.Name].Data.Colour,Player,function() | |
966 | DestroyTablets(Player); | |
967 | table.foreach(Core.Ranks,function(Index,Value) | |
968 | AddPart(Value.." - "..Index,Core.Players[Player.Name].Data.Colour,Player,function() | |
969 | if Core.Players[Player.Name].Rank < Core.Players[v.Name].Rank then | |
970 | DestroyTablets(Player); | |
971 | return AddPart(v.Name.." outranks you!","Bright red",Player,nil); | |
972 | end; | |
973 | DestroyTablets(Player); | |
974 | Core.Players[v.Name].Rank=Index; | |
975 | if Player ~= v then | |
976 | AddPart(v.Name.."'s rank is now "..Value,Core.Players[Player.Name].Data.Colour,Player,nil); | |
977 | end; | |
978 | AddPart("Your rank is now "..Value.." ["..Index.."]",Core.Players[v.Name].Data.Colour,v,nil); | |
979 | end); | |
980 | end); | |
981 | AddPart("Cancel","Bright red",Player,function() | |
982 | DestroyTablets(Player); | |
983 | end); | |
984 | end); | |
985 | AddPart("Dismiss","Bright red",Player,function() | |
986 | DestroyTablets(Player); | |
987 | end); | |
988 | AddPart("Kick","Bright orange",Player,function() | |
989 | local Success,Error=pcall(function() Core.Packets.Kick(v) end); | |
990 | if not Success then | |
991 | DestroyTablets(Player); | |
992 | AddPart("[Kick Packet] There was a serious error! Player was not kicked successfully!","Bright red",Player,nil); | |
993 | end; | |
994 | end); | |
995 | --[[ AddPart("Player Settings",Core.Players[Player.Name].Data.Colour,Player,function() | |
996 | AddPart("Auto Dismiss : "..Core.Players[Player.Name].Settings.AutoDismiss,Core.Players[Player.Name].Data.Colour,function() | |
997 | DestroyTablets(Player); | |
998 | AddPart("True","Bright green",Player,function() | |
999 | DestroyTablets(Play er); | |
1000 | Core.Players[Player.Name].Settings.AutoDismiss = true; | |
1001 | end) | |
1002 | ||
1003 | end) | |
1004 | end)]]-- | |
1005 | AddPart("Ban","Dusty Rose",Player,function() | |
1006 | local Success,Error=pcall(Core.Packets.Kick,v); | |
1007 | if not Success then | |
1008 | DestroyTablets(Player); | |
1009 | return AddPart("[Ban Packet] There was a serious error! Player was not banned successfully!","Bright red",Player,nil); | |
1010 | end; | |
1011 | wait(DestroyTablets(Player)); | |
1012 | AddPart("Would you like to add a reason?","Bright blue",Player,function() end) | |
1013 | AddPart("Yes","Bright green",Player,function() | |
1014 | DestroyTablets(Player); | |
1015 | table.foreach(Core.BanResponse,function(Index,Resp) | |
1016 | AddPart(Resp,"Really red",Player,function() | |
1017 | DestroyTablets(Player); | |
1018 | Core.Packets.BanR(v,Resp); | |
1019 | AddPart(v.Name.." is now banned for : "..Resp,"Bright green",Player,nil); | |
1020 | end); | |
1021 | end); | |
1022 | end); | |
1023 | AddPart("No","Really red",Player,function() | |
1024 | Core.Packets.Ban(v) | |
1025 | DestroyTablets(Player) | |
1026 | end) | |
1027 | end); | |
1028 | end; | |
1029 | if next(Flags) == nil then | |
1030 | DestroyTablets(Player); | |
1031 | function Main() | |
1032 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do | |
1033 | AddPart(v.Name,Core.Players[Player.Name].Data.Colour,Player,function() | |
1034 | wait(DestroyTablets(Player)); | |
1035 | AddPart("Name - "..v.Name,Core.Players[Player.Name].Data.Colour,Player,nil); | |
1036 | AddPart("Age - "..v.AccountAge,Core.Players[Player.Name].Data.Colour,Player,nil); | |
1037 | AddPart("BetKey - "..Core.Players[v.Name].Settings.BetKey,Core.Players[Player.Name].Data.Colour,Player,function() | |
1038 | DestroyTablets(Player); | |
1039 | table.foreach(Core.BetKeys,function(Index,Key) | |
1040 | AddPart(Key,Core.Players[Player.Name].Data.Colour,Player,function() | |
1041 | DestroyTablets(Player); | |
1042 | Core.Players[v.Name].Settings.BetKey=Key; | |
1043 | if Player ~= v then | |
1044 | AddPart(v.Name.."'s bet key is now "..Key,Core.Players[Player.Name].Data.Colour,Player,nil); | |
1045 | end; | |
1046 | AddPart("Your bet key is now "..Key,Core.Players[v.Name].Data.Colour,v,nil); | |
1047 | end) | |
1048 | end) | |
1049 | AddPart("Cancel","Bright red",Player,function() | |
1050 | DestroyTablets(Player); | |
1051 | end); | |
1052 | end); | |
1053 | AddPart("Colour - "..Core.Players[v.Name].Data.Colour,Core.Players[Player.Name].Data.Colour,Player,function() | |
1054 | local Colours={"White","Bright red","Bright green","Bright blue","Bright yellow","Toothpaste","Pink","Black"}; | |
1055 | DestroyTablets(Player); | |
1056 | table.foreach(Colours,function(Index,Colour) | |
1057 | AddPart(Colour,Colour,Player,function() | |
1058 | DestroyTablets(Player); | |
1059 | Core.Players[v.Name].Data.Colour=Colour; | |
1060 | if Player ~= v then | |
1061 | AddPart(v.Name.."'s default colour is now "..Colour,Core.Players[Player.Name].Data.Colour,Player,nil); | |
1062 | end; | |
1063 | AddPart("Your default colour is now "..Colour,Core.Players[v.Name].Data.Colour,v,nil); | |
1064 | end); | |
1065 | end); | |
1066 | AddPart("Cancel","Bright red",Player,function() | |
1067 | DestroyTablets(Player); | |
1068 | end); | |
1069 | end); | |
1070 | AddPart("Rank - "..Core.Players[v.Name].Rank,Core.Players[Player.Name].Data.Colour,Player,function() | |
1071 | DestroyTablets(Player); | |
1072 | table.foreach(Core.Ranks,function(Index,Value) | |
1073 | AddPart(Value.." - "..Index,Core.Players[Player.Name].Data.Colour,Player,function() | |
1074 | if Core.Players[Player.Name].Rank < Core.Players[v.Name].Rank then | |
1075 | DestroyTablets(Player); | |
1076 | return AddPart(v.Name.." outranks you!","Bright red",Player,nil); | |
1077 | end; | |
1078 | DestroyTablets(Player); | |
1079 | Core.Players[v.Name].Rank=Index; | |
1080 | if Player ~= v then | |
1081 | AddPart(v.Name.."'s rank is now "..Value,Core.Players[Player.Name].Data.Colour,Player,nil); | |
1082 | end; | |
1083 | AddPart("Your rank is now "..Value.." ["..Index.."]",Core.Players[v.Name].Data.Colour,v,nil); | |
1084 | end); | |
1085 | end); | |
1086 | AddPart("Cancel","Bright red",Player,function() | |
1087 | DestroyTablets(Player); | |
1088 | end); | |
1089 | end); | |
1090 | AddPart("Back","Bright blue",Player,function() | |
1091 | DestroyTablets(Player); | |
1092 | Main(); | |
1093 | end); | |
1094 | AddPart("Dismiss","Bright red",Player,function() | |
1095 | DestroyTablets(Player); | |
1096 | end); | |
1097 | AddPart("Kick","Bright orange",Player,function() | |
1098 | local Success,Error=pcall(function() Core.Packets.Kick(v) end); | |
1099 | if not Success then | |
1100 | DestroyTablets(Player); | |
1101 | AddPart("[Kick Packet] There was a serious error! Player was not kicked successfully!","Bright red",Player,nil); | |
1102 | end; | |
1103 | end); | |
1104 | AddPart("Ban","Dusty Rose",Player,function() | |
1105 | local Success,Error=pcall(function() Core.Packets.Kick(v) end); | |
1106 | if not Success then | |
1107 | DestroyTablets(Player); | |
1108 | return AddPart("[Ban Packet] There was a serious error! Player was not banned successfully!","Bright red",Player,nil); | |
1109 | end; | |
1110 | wait(DestroyTablets(Player)); | |
1111 | AddPart("Would you like to add a reason?","Bright blue",Player,function() end) | |
1112 | AddPart("Yes","Bright green",Player,function() | |
1113 | DestroyTablets(Player); | |
1114 | table.foreach(Core.BanResponse,function(Index,Resp) | |
1115 | AddPart(Resp,"Really red",Player,function() | |
1116 | DestroyTablets(Player); | |
1117 | Core.Packets.BanR(v,Resp); | |
1118 | AddPart(v.Name.." is now banned for : "..Resp,"Bright green",Player,nil); | |
1119 | end); | |
1120 | end); | |
1121 | end); | |
1122 | AddPart("No","Really red",Player,function() | |
1123 | Core.Packets.Ban(v) | |
1124 | DestroyTablets(Player) | |
1125 | end) | |
1126 | end); | |
1127 | end); | |
1128 | end; | |
1129 | end; | |
1130 | Main(); | |
1131 | end; | |
1132 | end); | |
1133 | end); | |
1134 | ||
1135 | NewCommand("Commands","Lists commands",1,{"cmds","commands"},{"rank","cmd"},function(Message,Flags,Player,PlayerRank) | |
1136 | function Ranks(Player) | |
1137 | local Player=Player; | |
1138 | wait(DestroyTablets(Player)); | |
1139 | for i,v in pairs(Core.Ranks) do | |
1140 | Colours={"White","Dusty Rose","Bright green","Bright blue","Bright yellow","Toothpaste","Pink","Bright violet"}; | |
1141 | AddPart("Rank "..i,Colours[i],Player,function() | |
1142 | wait(DestroyTablets(Player)); | |
1143 | for a,b in pairs(Core.Commands) do | |
1144 | if b.Rank==tonumber(i) then --{Name=Name,Desc=Desc,Rank=Rank,Calls=Calls,Flags=Flags,Function=Func} | |
1145 | AddPart(b.Name,Colours[i],Player,function() | |
1146 | wait(DestroyTablets(Player)); | |
1147 | AddPart("Min Rank : "..b.Rank,"Bright violet",Player,nil); | |
1148 | AddPart("Name : "..b.Name,Colours[i],Player,nil); | |
1149 | AddPart("Calls : "..string.gsub(unpack(b.Calls)," ","; "),"Royal purple",Player,nil); | |
1150 | pcall(function() AddPart("Flags : "..string.gsub(unpack(b.Flags)," ","; "),"Teal",Player,nil) end); | |
1151 | AddPart("Description : "..b.Desc,"Sand green",Player,nil); | |
1152 | AddPart("Back","Bright red",Player,function() | |
1153 | Ranks(Player); | |
1154 | end) | |
1155 | end); | |
1156 | end; | |
1157 | end; | |
1158 | AddPart("Back","Bright red",Player,function() | |
1159 | Ranks(Player); | |
1160 | end) | |
1161 | end) | |
1162 | end; | |
1163 | AddPart("Your Rank : "..Core.Players[Player.Name].Rank,"Dark green",Player,function() end) | |
1164 | end; | |
1165 | Ranks(Player); | |
1166 | end); | |
1167 | ||
1168 | NewCommand("Remove/Stop/Kill","Stops Prometheus",7,{"remove","nos"},{},function(Message,Flags,Player,PlayerRank) | |
1169 | pcall(function() | |
1170 | AddPart("[Prometheus]\nPrometheus is shutting down, please wait...","Bright green",Player,nil) | |
1171 | wait(3); | |
1172 | script:Destroy(); | |
1173 | end); | |
1174 | end); | |
1175 | ||
1176 | NewCommand("Explore","Sweep scans the game",5,{"explore","e"},{},function(Message,Flags,Player,PlayerRank) | |
1177 | local Search | |
1178 | local List | |
1179 | local ObjectFunctions = (function() | |
1180 | local NewData = {} | |
1181 | for ClassName, Data in next, { | |
1182 | Player = { | |
1183 | Kick = function(Player) | |
1184 | Core.Packets.Kick(Player) | |
1185 | end | |
1186 | }; | |
1187 | ["Part,WedgePart,Script,Model"] = { | |
1188 | Destroy = function(Self,Object) | |
1189 | if Object ~= script then | |
1190 | return Self.Destroy(Object); | |
1191 | else | |
1192 | return AddPart("Can not destroy script","Really red",Player,nil); | |
1193 | end | |
1194 | end; | |
1195 | Remove = function(Self,Object) | |
1196 | return Self.Destroy(Object); | |
1197 | end; | |
1198 | }; | |
1199 | } do | |
1200 | for NewClassName in tostring(ClassName):gmatch("[^,]+") do | |
1201 | NewData[NewClassName] = Data; | |
1202 | end; | |
1203 | end; | |
1204 | return NewData | |
1205 | end)() | |
1206 | function List(Object) | |
1207 | DestroyTablets(Player); | |
1208 | Object = Object or pcall(AddPart,"Can not explore out of DataModel","Really red",Player,nil) and game; | |
1209 | if ObjectFunctions[Object.ClassName] then | |
1210 | AddPart("View functions","Toothpaste",Player,function() | |
1211 | DestroyTablets(Player); | |
1212 | for Name, Function in next, ObjectFunctions[Object.ClassName] do | |
1213 | AddPart(Name,"Toothpaste",Player,function() | |
1214 | pcall(Function, Object); | |
1215 | end); | |
1216 | end; | |
1217 | AddPart("Back","Really red",Player,function() | |
1218 | List(Object); | |
1219 | end); | |
1220 | end); | |
1221 | else | |
1222 | AddPart("No functions found","Really red",Player,nil); | |
1223 | end; | |
1224 | AddPart("Explore: "..tostring(Object),"Toothpaste",Player,function() | |
1225 | Search(Object); | |
1226 | AddPart("View settings","Really red",Player,function() | |
1227 | List(Object); | |
1228 | end); | |
1229 | end); | |
1230 | AddPart("View parent","Really red",Player,function() | |
1231 | List(Object.Parent); | |
1232 | end); | |
1233 | end; | |
1234 | function Search(Parent) | |
1235 | DestroyTablets(Player); | |
1236 | for _, v in pairs(Parent:GetChildren()) do | |
1237 | pcall(AddPart,tostring(v),"Toothpaste",Player,function() | |
1238 | List(v); | |
1239 | end); | |
1240 | end; | |
1241 | end; | |
1242 | List(game); | |
1243 | end) | |
1244 | ||
1245 | NewCommand("Execute","Executes/Compiles Lua Code",1,{"exe"},{"http"},function(Message,Flags,Player,PlayerRank) | |
1246 | local Source = Message; | |
1247 | if Flags["http"] then | |
1248 | local success,error = ypcall(function() game:GetService("HttpService"):GetAsync(Flags["http"][1]:sub(2)) end); | |
1249 | if not success then | |
1250 | return AddPart("There was an error while loading your script.","Really red",Player,nil); | |
1251 | end; | |
1252 | Source = Core.Services.HttpGet(Flags["http"][1]:sub(2)) | |
1253 | end | |
1254 | if next(Flags) == nil then | |
1255 | Source = Message; | |
1256 | end; | |
1257 | local game=game; | |
1258 | local error=error; | |
1259 | local print=print; | |
1260 | local ypcall=ypcall; | |
1261 | local pcall=pcall; | |
1262 | local Spawn=Spawn; | |
1263 | local coroutine=coroutine; | |
1264 | local setmetatable=setmetatable; | |
1265 | local loadstring=loadstring; | |
1266 | local getmetatable=getmetatable; | |
1267 | local setfenv=setfenv; | |
1268 | local getfenv=getfenv; | |
1269 | local env = {}; | |
1270 | local envs = {}; | |
1271 | local newproxy=newproxy; | |
1272 | Execute,Error=loadstring(tostring(Source),"[Prometheus Execute]"); | |
1273 | ||
1274 | local scriptS = newproxy(true); | |
1275 | local meta = getmetatable(scriptS); | |
1276 | ||
1277 | meta.__metatable=getmetatable(script); | |
1278 | ||
1279 | function meta:__tostring() | |
1280 | return tostring(script); | |
1281 | end; | |
1282 | ||
1283 | function getmember(item,index) | |
1284 | return item[index]; | |
1285 | end; | |
1286 | ||
1287 | function setmember(item,index,value) | |
1288 | item[index]=value; | |
1289 | end; | |
1290 | ||
1291 | function meta:__index(index) | |
1292 | local suc,res=pcall(getmember,script,index); | |
1293 | if(not suc)then | |
1294 | error(index..' is not a valid member of Script',2); | |
1295 | else | |
1296 | if index:lower() == "destroy" then | |
1297 | return function() | |
1298 | error'You cannot destroy this script'; | |
1299 | end; | |
1300 | elseif index:lower() == "remove" then | |
1301 | return function() | |
1302 | error'You cannot remove this script'; | |
1303 | end; | |
1304 | end; | |
1305 | if type(res)=='function' then | |
1306 | return function(self,...) | |
1307 | return self[index](self,...) | |
1308 | end; | |
1309 | else | |
1310 | return res; | |
1311 | end; | |
1312 | end; | |
1313 | end; | |
1314 | ||
1315 | function meta:__newindex(index,value) | |
1316 | suc,res=pcall(setmember,script,index,value); | |
1317 | return scriptS; | |
1318 | end; | |
1319 | ||
1320 | for i,v in next, { | |
1321 | ["restart"]=function() | |
1322 | --Future function. | |
1323 | end; | |
1324 | ["print"]=function(...) | |
1325 | local Data={...}; | |
1326 | for CurrentEntry,Table_Pos in next,Data do | |
1327 | if not pcall(function()Data[CurrentEntry]=tostring(Table_Pos);end)then | |
1328 | Data[CurrentEntry]='__TOSTRING_EDIT'; | |
1329 | end; | |
1330 | end; | |
1331 | AddPart(tostring(table.concat(Data,' ')),'White',Player,nil); | |
1332 | end; | |
1333 | ["error"]=function(...) | |
1334 | local Data={...}; | |
1335 | for CurrentEntry,Table_Pos in next,Data do | |
1336 | if not pcall(function()Data[CurrentEntry]=tostring(Table_Pos);end)then | |
1337 | Data[CurrentEntry]='__TOSTRING_EDIT'; | |
1338 | end; | |
1339 | end; | |
1340 | AddPart(tostring(table.concat(Data,' ')),'Really red',Player,nil); | |
1341 | end; | |
1342 | ["warn"]=function(...) | |
1343 | local Data={...}; | |
1344 | for CurrentEntry,Table_Pos in next,Data do | |
1345 | if not pcall(function()Data[CurrentEntry]=tostring(Table_Pos);end)then | |
1346 | Data[CurrentEntry]='__TOSTRING_EDIT'; | |
1347 | end; | |
1348 | end; | |
1349 | AddPart(tostring(table.concat(Data,' ')),'Bright orange',Player,nil); | |
1350 | end; | |
1351 | ['loadstring']=function(str,...) | |
1352 | if str == nil then return error("Argument #1 (string expected, got nil)") end | |
1353 | local rtn={}; | |
1354 | local fArgs={...}; | |
1355 | local succ,res=ypcall(function() | |
1356 | rtn={loadstring(str,unpack(fArgs))}; | |
1357 | end); | |
1358 | if(not succ)then return Execute.error(res) end; | |
1359 | local func,err=unpack(rtn); | |
1360 | if(func)then | |
1361 | func=setfenv(func,NewEnvironment); | |
1362 | end; | |
1363 | return func,err | |
1364 | end; | |
1365 | Core = "Hide"; | |
1366 | Alert = "Hide"; | |
1367 | owner = Player; | |
1368 | NewEnvironment = "Hide"; | |
1369 | FindPlayer = "Hide"; | |
1370 | NewCommand = "Hide"; | |
1371 | DestroyTablets = "Hide"; | |
1372 | CheckBanned = "Hide"; | |
1373 | OnChatted = "Hide"; | |
1374 | Execute = "Hide"; | |
1375 | CLerp = "Hide"; | |
1376 | ["script"] = scriptS; | |
1377 | }do | |
1378 | for str in i:gmatch'([^,]+)'do | |
1379 | env[str]=v; | |
1380 | end; | |
1381 | end; | |
1382 | ||
1383 | NewEnvironment = { | |
1384 | _SANDBOX = "PK_SANDBOX v1.0"; | |
1385 | }; | |
1386 | if (Execute) then | |
1387 | --setfenv(0,NewEnvironment); | |
1388 | local Success,Result=ypcall(setfenv(Execute,setmetatable(NewEnvironment,{ | |
1389 | __index=function(Self,Index) | |
1390 | local Return = env[Index]; | |
1391 | local OldReturn = getfenv()[Index]; | |
1392 | if Return == "Hide" then | |
1393 | return Core.Data.Fakes._G[Index]; | |
1394 | elseif Return == nil then | |
1395 | return OldReturn; | |
1396 | else | |
1397 | return Return; | |
1398 | end; | |
1399 | end; | |
1400 | __metatable="Locked!"; | |
1401 | }))); | |
1402 | if (not Success) then | |
1403 | AddPart(Result,"Really red",Player,nil); | |
1404 | end; | |
1405 | else | |
1406 | AddPart(Error,"Really red",Player,nil); | |
1407 | end; | |
1408 | end); | |
1409 | ||
1410 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do | |
1411 | ConnectPlayer(v); | |
1412 | if Core.Cloud ~= nil then | |
1413 | AddPart("The Cloud is active","Bright blue",v,nil); | |
1414 | end | |
1415 | end; | |
1416 | ||
1417 | game:GetService("Players").PlayerAdded:connect(function(Player) | |
1418 | ConnectPlayer(Player); | |
1419 | Alert(Player.Name.." has joined the game!"); | |
1420 | end); | |
1421 | ||
1422 | game:GetService("Players").PlayerRemoving:connect(function(Player) | |
1423 | DestroyTablets(Player); | |
1424 | Alert(Player.Name.." has left the game!"); | |
1425 | end); |