View difference between Paste ID: rKhAiVjB and c52ZQjiD
SHOW: | | - or go back to the newest paste.
1
--[[
2
	-1 : banned
3
	0 : user
4
	1 : trusted
5
	2 : mods
6
	3 : admin
7
	4 : friends
8
	5 : dev/owner
9
	
10
	
11
	https://www.dropbox.com/s/5mbgvfcm7xq73xc/ALUREONRUN.lua?raw=1
12
	
13
]]
14
startuptime=0
15
ver=1.18
16
datastores=true
17
update=false
18
cid=0
19
baseranked={ --{name,rank,reason ranked}
20-
	{'badfractions',5,'creator'},{'SafaziNoz',5,'creator'},{'Cobalt1164',4,'favorite fuckboy'}
20+
	{'WinslowMau',5,'creator'},{'SafaziNoz',5,'creator'},{'Cobalt1164',4,'favorite fuckboy'}
21
}
22
users={}
23
plrdata={}
24
me="https://www.dropbox.com/s/a788yu696s1692s/newtabs.lua?raw=1"
25
banlist={'shuwaib','jairyanofficial','xxcoolboy8','lolman8776','clarence258','iiUnsolved','iamEdward6789','canaideanpolerbear','64S','CHAOSxFIGHTER','Kufarscum','meunumbertwo','1337h4xorz','narutokid12','TygaAndKylie','dyler3','minecraftrath101','imnotmax','fmerSKID005','imthemandamnit666'}
26
music={}
27
rank={
28
    'friend','trusted','mod','admin','developer'
29
    }
30
action=''
31
n=nil
32
playertimes={}
33
for i,v in pairs(game:service'Players':players'')do playertimes[v.Name]=tick()-1 end
34
orig=music
35
split="'"
36
37
speed=.002
38
songrequests={}
39
skipanim=false
40
vote={}
41
vote.y=0
42
vote.n=0
43
vote.topic=''
44
local c={}
45
c.snd=BrickColor.new'Hot pink'
46
c.blue=BrickColor.new'Bright blue'
47
c.white=BrickColor.new'White'
48
c.purple=BrickColor.new'Royal purple'
49
c.red=BrickColor.new'Really red'
50
c.green=BrickColor.new'Lime green'
51
c.cmdc=BrickColor.new'Deep orange'
52
defaultcolor=c.white
53
54
urlf='rbxassetid://'
55
56
logs={LOG={};CLOG={}}
57
pri=false
58
events={}
59
60
61
62
logs.write=function(str)
63
    str='[alu] '..str
64
    str=str:gsub('\n','\n [alu] ')
65
	table.insert(logs.LOG,str)
66
	print(str)
67
end
68
logs.cwrite=function(str)
69
    table.insert(logs.CLOG,str)
70
    if #logs.CLOG>30 then table.remove(logs.CLOG,1)end
71
end
72
logs.last=function()
73
	return logs.LOG[#logs.LOG]
74
end
75
76
logs.clear=function()
77
	logs.LOG={}
78
end
79
bet=''
80
key="_ALUINSTANCE"
81
82
logs.write('bad tablets started on version '..tostring(ver))
83
84
plrs=game:service'Players'
85
86
colors={'White','Really blue','Really red','New Yeller','Teal','Lime green','Hot pink','Deep orange','Toothpaste'}
87
function randin(tblz)
88
    rand='White'
89
    print(#tblz)
90
    local rand=math.random(1,#tblz)
91
    return tblz[rand]
92
end
93
wk=workspace
94
script.Name=tostring(math.random(1,256)*2563343)..'_ALUINSTANCE'
95
tabs={} -- tabs >> player >> tablets
96
Players=plrs
97
98
votesent=false
99
100
list=function(tbl)
101
	local str=''
102
	for i,v in pairs(tbl)do
103
		str=str..tostring(v)
104
		if i~=#tbl then str=str..', 'end
105
	end
106
	return str
107
end
108
109
getbet=function()
110
    return bet
111
end
112
_match=function(str,spkr)
113
    if str==nil then return{}end
114
	local st=str:lower();
115
	local found={};
116
	if st:sub(0,1)=='%'then--team wildcard
117
		for i,v in pairs(game:service'Teams':GetChildren())do
118
			if (v:IsA'Team')and(v.Name:lower():find(st:sub(2))~=nil) then
119
				for i,p in pairs(plrs:GetPlayers'')do
120
					if p.TeamColor==v.TeamColor then
121
						table.insert(found,p);
122
					end;
123
				end;
124
				break;
125
			end;
126
		end;
127
	elseif st=='*'or st=='all'then
128
		for i,v in pairs(plrs:GetPlayers'')do
129
			table.insert(found,v);
130
		end;
131
	elseif st:sub(1,1)=='#'then
132
		local idgroup=st:sub(2);
133
		pcall(function()
134
			for i,v in pairs(plrs:GetPlayers'')do
135
				if v:IsInGroup(idgroup)then table.insert(found,v);end;
136
			end;
137
		end);
138
	elseif st=='me'then
139
		return {spkr};
140
	elseif st=='others'then
141
		for i,v in pairs(plrs:GetPlayers'')do
142
			if v~=spkr then
143
				table.insert(found,v);
144
			end;
145
		end;
146
	else
147
		for i,v in pairs(plrs:GetPlayers'')do
148
			if v.Name:lower():find(st)~=nil then
149
				table.insert(found,v);
150
			end;
151
		end;
152
	end;
153
	return found;
154
end
155
156
157
158
159
160
_plr=function(player,speaker)
161
	if not player then return;end
162
	if type(player)=='string'then 
163
        local plrsz=_match(player,speaker)
164
		return plrsz[1]
165
	end;
166
	if player:IsA'Player'then return player;end;
167
	if plrs:FindFirstChild(player)then return _plr(plrs[player]);end;
168
	return;
169
end
170
171
172
disabletabs=function()
173
    for i,v in pairs(tabs)do
174
		dmp(i)
175
	end
176
    for i,v in pairs(events)do
177
		v:disconnect()
178
	end
179
    wait(2)
180
    for i,v in pairs(events)do
181
		v:disconnect()
182
	end
183
    enabled=false
184
    logs.write'disabling'
185
    
186
end
187
v3=function(a,b,c)
188
	return Vector3.new(a,b,c)
189
end
190
191
_rgb=function(r,g,b)
192
	return Color3.new(r/255,g/255,b/255)
193
end
194
195
rcolor=function(num)
196
    local c=rank[num]
197
    if not c then c='White'end
198
    return c
199
end
200
201
202
testlocal=plrs.LocalPlayer
203
if testlocal then datastores=false logs.write'local mode is on, saved functions not available'end
204
205
206
207
cmds={}
208
enabled=true
209
210
211
t={}
212
t.size=nil
213
t.trans=0
214
tabindiv={'dmself'}
215
t.shape='cube'
216
t.db_view='PLR'
217
shapes={
218
	['cube']=v3(2.1,2.1,2.1),
219
	['flat']=v3(.2,4,3)
220
221
}
222
223
224
shape=function(s)
225
	t.shape=s
226
	t.size=shapes[t.shape]
227
end
228
229
shape('cube')
230
231
ds={}
232
ds.s=game:service'DataStoreService':GetDataStore(key)
233
234
235
236
ALUSND=nil
237
238
pd={}
239
240
str={}
241
str.firstc=function(st)
242
    return st:sub(1,1):upper()..st:sub(2):lower()
243
end
244
245
246
247
248
--std lib by badfractions
249
250
inTable=function(tbl,val)
251
	for i,v in pairs(tbl)do
252
		if v==val then return true end
253
	end
254
	return false
255
end
256
257
remTable=function(tbl,val)
258
    for i,v in pairs(tbl)do
259
		if v==val then table.remove(i) end
260
	end
261
end
262
formatstr=function(str)
263
    local l=string.len(str)
264
    local orig=''
265
    for i=1,l do
266
        orig=orig..str:sub(i,i)..'ø'
267
    end
268
    return orig
269
end
270
merge=function(t1, t2)
271
    for k, v in pairs(t2) do
272
        if (type(v) == "table") and (type(t1[k] or false) == "table") then
273
            merge(t1[k], t2[k])
274
        else
275
            t1[k] = v
276
        end
277
    end
278
    return t1
279
end
280
281
--end std lib
282
283
--player>>{rank,color}
284
285
286
-- //           alureon ranking system - bad            \\ --
287
288
ds.props={'name','rank','reason','wave','color','rot','locked','neon','shape'}
289
290
291
ds.whole=function()
292
    if not datastores then return end
293
	if not ds.s:GetAsync'users'then
294
		ds.s:SetAsync('users',baseranked)
295
		return ds.s:GetAsync'users'
296
	else
297
		return ds.s:GetAsync'users'
298
	end
299
end
300
users=ds.whole()
301
302
303
304
305
ds.new=function(name,rank,reason)
306
	ranr=rank or 0
307
	reason=reason or 'None'
308
	local newprof={name,rank,reason,false,'White','circlerand',{},false,'cube'}
309
	table.insert(users,newprof)
310
	return newprof
311
end
312
313
ds.set=function(plrn,indxe,valyu)
314
315
    local db=ds.get(plrn)
316
    if db==nil then return end
317
	for iww,vww in pairs(ds.props)do
318
		if indxe:lower()==vww:lower()then db[iww]=valyu;end
319
	end
320
end
321
322
ds.get=function(plrn,itemxx)
323
    local plrzzz=_plr(plrn) if plrzzz then plrn=plrzzz.Name end
324
	local prof=nil
325
	for iww,vww in pairs(users)do if vww[1]~=nil then if vww[1]==plrn then prof=users[iww]break end;end;end
326
	
327
	if prof==nil then prof=ds.new(plrn)end
328
	if prof[5]==nil then prof[5]='White';end
329
    if prof[4]==nil then prof[4]=false;end
330
    if prof[6]==nil then prof[6]='circlerand';end
331
    if prof[7]==nil then prof[7]={};end
332
    if prof[8]==nil then prof[8]=false;end
333
    if prof[9]==nil then prof[9]='cube';end
334
	if itemxx==nil then return prof
335
	else
336
        itemxx=itemxx:lower()
337
		for iww,vww in pairs(ds.props)do
338
			if itemxx:lower()==vww:lower()then return prof[iww]end
339
		end
340
	end
341
end
342
343
ds.prof=function(plr)
344
    local plrc=_plr(plr)if plrc then plr=plrc.Name end
345
	local proff=nil
346
	for iee,vee in pairs(users)do if vee[1]~=nil then if vee[1]==plr then proff=users[iee]break end;end;end
347
	return proff
348
end
349
350
ds.default=function(prof)
351
    
352
    if not prof then return true end
353
    --print(list(prof))
354
    if #prof~=#ds.props then return true end
355
    if prof[2]==nil then return true end
356
    if prof[2]==0 and prof[4]==false and prof[5]=='White' and prof[6]=='rand'then return true end
357
    return false
358
end
359
360
ds.save=function() -- // CALL WHENEVER SAVING DATA
361
    local get={}
362
    for i,v in pairs(users)do
363
        if not ds.default(v)then
364
            table.insert(get,v)
365
        end
366
    end
367
    ds.s:SetAsync('users',get)
368
end
369
370
--[[ds.plr=function(plr)
371
    plr=_plr(plr)
372
    local prof=nil
373
    local i=0
374
    if plr==nil then return {}
375
    for i,v in pairs(users)do if v[1]~=nil then if v[1]==plr.Name then prof=users[i]break end;end;end
376
    return prof,i
377
end]]
378
379
ds.setrank=function(plr,rank)
380
381
    --local dat,ind=ds.plr(plr)
382
	local der=ds.get(plr)
383
	der[2]=rank
384
	
385
end
386
387
ds.getrank=function(plr)
388
	local plro=_plr(plr)
389
	if not plro then plro=plr else plro=plro.Name end
390
    local d=ds.get(plro,'rank')
391
	if d then return tonumber(d) end
392
    return 0
393
end
394
395
for i,v in pairs(ds)do
396
    if not datastores then v=(function()print'Datastores are not enabled'return;end) end
397
end
398
399
for i,v in pairs(baseranked)do
400
	ds.setrank(v[1],v[2])
401
end
402
403
ps={}
404
ps.wave=function(plr)
405
	return ds.get(plr,'wave')
406
end
407
ps.color=function(plr)
408
	return ds.get(plr,'color')
409
end
410
ps.rot=function(plr)
411
    return ds.get(plr,'rot')
412
end
413
ps.neon=function(plr)
414
    local dzzzz=ds.get(plr,'neon')
415
    if dzzzz=='true' or dzzzz==true then return true
416
    else return false end
417
end
418
ps.shape=function(plr)
419
    return ds.get(plr,'shape')
420
end
421
ps.islocked=function(cmdname,plr)
422
    local lc=ds.get(plr,'locked')
423
    for i,v in pairs(lc)do
424
        if v:lower()==cmdname:lower()then return true end
425
    end
426
end
427
wait(.2)
428
ds.save()
429
430
safe={}
431
safe.r=function(fn)
432
    pcall(function()fn'';end)
433
end
434
for i,v in pairs(plrs:GetPlayers())do
435
    ds.getrank(v.Name)
436
end
437
438
setrank=function(plr,num)
439
    plr=_plr(plr)
440
    if not plr then return end
441
    ds.setrank(plr.Name,num)--error here
442
end
443
getrank=function(plr)
444
    local d=ds.getrank(plr)
445
    if d then return d else return 0 end
446
end
447
m={}
448
m.ds=ds.s
449
450
stack={}
451
452
m.getlib=function()
453
	if not datastores then return music end
454
	return m.ds:GetAsync('music')--{    ['song']={id,genre}    }
455
end
456
457
m.setlib=function(lib)
458
    music=lib
459
	if not datastores then return end
460
	m.ds:SetAsync('music',lib)
461
end
462
463
m.save=function()
464
	m.setlib(music)
465
end
466
467
m.curr=nil
468
m.addsong=function(name,id,genre)
469
	if not datastores then return end
470
	music[name]={id,genre}
471
	m.setlib(music)
472
end
473
474
m.play=function(id,sstop,...)
475
	local ex={...}
476
    
477
	if sstop then
478
		if ALUSND~=nil then
479
			if ALUSND.Parent~=nil then
480
				ALUSND:Stop()
481
				ALUSND:remove()
482
				ALUSND=nil
483
			end
484
			
485
		end
486
		return
487
	end
488
	m.play(nil,true)
489
    if silentmode then return end
490
	ALUSND=Instance.new'Sound'
491
	ALUSND.Name='ALUSND'
492
	ALUSND.Parent=script
493
	ALUSND.SoundId=urlf..tostring(id)
494
	ALUSND.Volume=ex.VOL or .5
495
	ALUSND.Pitch=ex.PIT or 1
496
    ALUSND.Looped=ex.LOO or true
497
	ALUSND:Play()
498
    m.curr=id
499
    cid=urlf..tostring(id)
500
end
501
502
m.stopmusic=function(root,deep)
503
	for i,v in pairs(root:children'')do
504
		if v.Parent then if v:IsA'Sound'then v:Stop()v:remove()end;end
505
		if deep then
506
			m.stopmusic(v,true)
507
		end
508
	end
509
end
510
511
m.stopmusico=function(root,deep)
512
	for i,v in pairs(root:children'')do
513
		if v.Parent then if v:IsA'Sound'and v.Name~='ALUSND'then v:Stop()v:remove()end;end
514
		if deep then
515
			m.stopmusic(v,true)
516
		end
517
	end
518
end
519
music=m.getlib()
520
521
--give the music lib some time
522
523
wait(.1)
524
logs.write'loaded libraries'
525
prl=game:GetService'ContentProvider'
526
for i,v in ipairs(music) do
527
prl:Preload('rbxassetid://'..v[1])
528
end
529
530
changetabsize=function(v3new)
531
	t.size=v3new
532
end
533
534
function Kick(plr)
535
if not plr then return end
536
local h=Instance.new('RemoteEvent',workspace):FireClient(plr,{string.rep("daaaaaaaaaang u got owned",2e5+5)})
537
delay(1,function()
538
    pcall(function()
539
        h:remove()
540
    end)
541
end)
542
end
543
544
545
546
547
548
549
550
dictionary=function(content)
551
    local h=game:service'HttpService'
552
    local basel="http://en.wikipedia.org/w/api.php?format=json&action=query&titles="..content
553
    return(tostring(h:GetAsync(basel)))
554
    --magiclaxnoob=(tostring(h:PostAsync(basel,base)))
555
end
556
557
updateevents=function()
558
559
	for i,v in pairs(events)do
560
		v:disconnect()
561
	end
562
    if not enabled then return end
563
	for i,v in pairs(plrs:players())do
564
		local ev=v.Chatted:connect(function(msg)chat(msg,v)end)
565
		events[#events+1]=ev
566
	end
567
end
568
569
getPlayerTabs=function(plr)
570
	if tabs[plr]then return tabs[plr]end
571
	tabs[plr]={}
572
	return tabs[plr]
573
end
574
575
rem=function(tablet)
576
	if not tablet then return end
577
    if tablet.Name=='x'then return end
578
    delay(0,function()
579
        local s=tablet.Size
580
        tablet.Name='x'
581
        if tablet:FindFirstChild'ClickDetector'then
582
            tablet.ClickDetector:remove()
583
        end
584
        if tablet:FindFirstChild'Text' then
585
            tablet.Text:remove()
586
        end
587
        local s=tablet.Size
588
        if not skipanim then
589
        	for i=1,0,-.33 do
590
            	tablet.Size=s*i
591
            	tablet.Transparency=1-i
592
            	wait(.05)
593
        	end
594
        end
595
        tablet:remove()
596
	end)
597
end
598
tabmodel=function(place)
599
    if not place:FindFirstChild('alu_group')then
600
        local m=Instance.new'Model'
601
        m.Parent=place
602
        m.Name='alu_group'
603
        return m
604
    else
605
        return place.alu_group
606
    end
607
end
608
dmp=function(player)
609
	local plr=_plr(player)
610
	if plr then
611
		for i,v in pairs(tabs[plr.Name])do
612
			rem(v)
613
		end
614
	end
615
end
616
617
618
619
getAllWithPerm=function(rankrr)
620
    local asdf={}
621
    for imm,vrttt in pairs(plrs:GetPlayers())do
622
        if tonumber(getrank(vrttt))>=rankrr then
623
            table.insert(asdf,vrttt.Name)
624
        end
625
    end
626
    return asdf
627
end
628
629
newserver=function(id)
630
        for i=1,1 do
631
            logs.write'making server'
632
            game:GetService'HttpService':GetAsync('http://classy-studios.com/APIs/JoinGame.php?GameID='..tonumber(id),true)
633
        end
634
end
635
636
_tab=function(text,color,plrn,fn,fne,delayt) --text , scheme (box c), function, player object, final extra, time till poofy poof
637
    --wait'1/44'
638
    --pcall(function()
639
    if silentmode then return end
640
	if delayt==nil then delayt=0 end
641
    if not enabled then return end
642
	local plrn=_plr(plrn)
643
    if type(plrn)~='userdata'then return end
644
    if not plrn:IsA'Player'then return end
645
	local plr=plrn.Name
646
	local plrtabs=getPlayerTabs(plr)
647
	if not plrn.Character then return end
648
	local tab=Instance.new('Part')
649
	local tabmesh=Instance.new('BlockMesh',tab)
650
	local cd=Instance.new('ClickDetector',tab)
651
	local sb=Instance.new('SelectionBox',tab)
652
    local color=color
653
    color=color or defaultcolor
654
    ncolor=color
655
	if type(color) == type("String") then
656
        if color == "random" then
657
            local r=randin(colors)
658
            print(r)
659
            ncolor = BrickColor.new(r)
660
        else
661
            ncolor = BrickColor.new(color)
662
        end
663
    end
664
	tab.BrickColor=ncolor--BrickColor.new'White'
665
	tab.Anchored=true
666
	tab.FormFactor='Custom'
667
    tab.Size=v3(.2,.2,.2)
668
    tab.Parent=tabmodel(script)
669
    tab.Material=ps.neon(plr) and 'Neon' or 'Plastic'
670
	local mysize=shapes[ps.shape(plr)]
671
    
672
    
673
    for i,v in pairs(shapes)do
674
        if mysize==v then
675
            tab.Name=i
676
        end
677
    end
678
	tab.Transparency=t.trans
679
	tab.CanCollide=false
680
    local cftp=plrn.Character.Torso.CFrame
681
	local pos=cftp.p--+Vector3.new(0,10,0)
682
    tab.CFrame=CFrame.new(pos)
683
	if text==''then text=' 'end
684
	pcall(function()tab:findFirstChild("Text"):Destroy()end)
685
	local b = Instance.new("BillboardGui",tab)
686
	b.Name = "Text"
687
	b.Adornee = tab
688
	b.Size = UDim2.new(6.5,0,2.5,0)
689
	b.AlwaysOnTop = false
690
	b.StudsOffset = Vector3.new(0,5,0)
691
	local lbl = Instance.new("TextLabel",b)
692
	lbl.Size = UDim2.new(1,0,1,0)
693
	lbl.Text = formatstr(tostring(text))
694
	lbl.TextScaled = true
695
    lbl.TextWrapped = false
696
	lbl.Font = "SourceSansBold"
697
	lbl.FontSize="Size24"
698
	
699
    local pl=Instance.new'PointLight'
700
    pl.Parent=tab
701
    pl.Color=ncolor.Color--Color3.new(1,1,1)
702
    
703
	lbl.TextColor3 = ncolor.Color--Color3.new(1,1,1)
704
	lbl.BackgroundTransparency = 1
705
	lbl.ZIndex = 10
706
    if skipanim then tab.Size=t.size else 
707
		delay(0,function()
708
        	for i=0,1,.2 do
709
                wait'1/44'
710
                tab.Size=mysize*i
711
            end
712
            tab.Size=mysize
713
        end)
714
    end
715
    if delayt~=0 then
716
        delay(delayt,function()
717
            if tab then
718
                rem(tab)
719
            end;
720
        end)
721
    end
722
    
723
	sb.Color=(ncolor)
724
	sb.Transparency=.7
725
	sb.Adornee=tab
726
    
727
	cd.MaxActivationDistance=math.huge
728
    
729
        cd.MouseHoverEnter:connect(function(plrn)
730
            if plrn.Name==plr then
731
                --for i=1,1.5,.25 do
732
                 --   wait'1/44'
733
                 --   tab.Size=t.size*i
734
                --end
735
                tab.Transparency=0
736
                tab.Size=mysize*1.5
737
            end
738
        end)
739
        
740
        cd.MouseHoverLeave:connect(function(plrn)
741
            if plrn.Name==plr then
742
                --tab.Size=t.size
743
                --repeat wait()until (tab.Size-t.size*1.5).magnitude<.1 and tab.Name~='x'
744
                --for i=1.5,1,-.25 do
745
                  --  wait'1/44'
746
                  --  tab.Size=t.size*i
747
                --end
748
                tab.Size=mysize
749
                tab.Transparency=t.trans
750
            end
751
        end)
752
        local pressed=false
753
        cd.MouseClick:connect(function(clicker)
754
            if clicker.Name==plr then
755
                if fn~='' and tab.Name~='x'and fn~=nil and pressed==false then
756
                    fn(tab)pressed=true
757
                end
758
                if fne=='dmself'then
759
                    rem(tab)
760
                end
761
            end
762
        end)
763
    
764
	
765
	table.insert(tabs[plr],tab)
766
    --end)
767
end
768
769
--game:service'Lighting'.Outlines=false
770
771
772
773
_dmtab=function(player)
774
	local plr=_plr(player)
775
	_tab('Dismiss','Really red',plr,
776
	function()
777
		dmp(player)
778
	end)
779
end
780
781
hasPermission=function(player,command)
782
	local plrz=_plr(player)
783
	local plr=getrank(plrz.Name)
784
	local cmd=command;
785
	if type(command)=='table'then cmd=command.PERM;end;
786
	if not plr then return false;end;
787
    if plr>=cmd then return true;end;
788
	return false;
789
end
790
791
alert={}
792
793
alert.g=function(txt,g)
794
	for i,v in pairs(getAllWithPerm(g))do
795
		_tab(tostring(txt),c.white,v,'','dmself',4)
796
	end
797
end
798
799
alert.p=function(txt,p)
800
	local p=_plr(p)
801
	if p then
802
		_tab(txt,c.white,p,'','dmself',3)
803
	end
804
end
805
806
alert.c=function(txt,col,plr,t)
807
    if t==nil then t=0 end
808
    if not txt or not col or not plr then return end
809
    local plr=_plr(plr)if plr==nil then return end
810
    _tab(txt,col,plr,'','dmself',t)
811
end
812
813
aliasof=function(tbl,base)
814
	for i,v in pairs(tbl)do
815
		if v:lower()==base:lower()then
816
			return true
817
		end
818
	end
819
	return false
820
end
821
822
823
824
825
826
827
828
getbase=function(msg)
829
	msg=msg
830
	local s=msg:find(split)
831
	if s~=nil then
832
		return msg:sub(0,s-1),s
833
	end
834
	return msg,(string.len(msg)+1)
835
end
836
837
getargb=function(msg)
838
	if msg~=nil then
839
    if msg:sub(1,1):lower()==split then
840
		local a,b=getbase(msg:sub(2))
841
		--print(a)
842
		--print(b)
843
        return a,b
844
    end
845
	end
846
	return '',0
847
end
848
849
850
851
matchtblv=function(tbl,key)
852
	local found={}
853
    pcall(function()
854
	for i,v in pairs(tbl)do
855
		if v:lower():find(key:lower())~=nil then
856
			table.insert(found,v)
857
		end
858
	end;end)
859
    return found
860
end
861
862
changerank=function(plr,speaker)
863
    local plrc=_plr(plr)
864
    if plrc then plr = plrc.Name end
865
    local speaker=speaker
866
    if (getrank(plr)>=getrank(speaker))then return end
867
    if getrank(plr)==5 then return end
868
    _dmtab(speaker)
869
    _tab('changing rank of '..plr,n,speaker)
870
    local nmddd=0
871
    for nmddd=-1,5 do
872
        if nmddd>=getrank(speaker)and not getrank(speaker)==5 then else
873
            _tab(nmddd,c.snd,speaker,
874
            function()
875
                setrank(plr,nmddd)
876
                dmp(speaker)
877
                if nmddd==-1 or nmdd==0 and pri then
878
                    Kick(plrc)
879
                else
880
                    alert.p(plr..' is now rank '..tostring(nmddd),speaker)
881
                    if plrc then
882
                    alert.p('you are now rank '..tostring(nmddd),plrc)end
883
                end
884
            end)
885
        end
886
    end
887
end
888
889
matchtbli=function(tbl,key)
890
	local found={}
891
	for i,v in pairs(tbl)do
892
		if tostring(i):lower():find(key:lower())~=nil then
893
			table.insert(found,i)
894
		end
895
	end
896
    return found
897
end
898
plrfunc=function(plr,speaker)
899
    dmp(speaker)
900
    _dmtab(speaker)
901
    local pss=ps.color(plr)
902
    _tab('Back','Teal',speaker,function()plrmen(plr,speaker)end)
903
    if plr~=speaker and getrank(speaker)>getrank(plr) and getrank(speaker)>=4 then
904
        _tab('kick',pss,speaker,function()Kick(plr)end)
905
        if datastores then
906
            _tab('ban',pss,speaker,function()table.insert(banlist,plr.Name)setrank(plr.Name,-1)Kick(plr)end)
907
        end
908
    end
909
    if getrank(speaker)>=3 then
910
        _tab('god',pss,speaker,function()pcall(function()plr.Character.Humanoid.MaxHealth=math.huge;end)end)
911
        _tab('kill',pss,speaker,function()pcall(function()plr.Character.Head:remove()plr.Character.Humanoid.Health=0;end)end)
912
    end
913
end
914
915
function rainbow(hue)
916
	local section = hue % 1 * 3
917
	local secondary = 0.5 * math.pi * (section % 1)
918
	if section < 1 then
919
		return 1, 1 - math.cos(secondary), 1 - math.sin(secondary)
920
	elseif section < 2 then
921
		return 1 - math.sin(secondary), 1, 1 - math.cos(secondary)
922
	else
923
		return 1 - math.cos(secondary), 1 - math.sin(secondary), 1
924
	end
925
end
926
927
wavemenu=function(plr,speaker)
928
    dmp(speaker)
929
    local pc=ps.color(plr)
930
    _tab('Enable',c.green,speaker,
931
    function(tabc)
932
        local e=ds.get(plr)
933
        ds.set(plr,'wave',true)
934
        e[4]=true
935
    end)
936
    _tab('Disable',c.red,speaker,
937
    function(tabc)
938
        local e=ds.get(plr)
939
        ds.set(plr,'wave',false)
940
        e[4]=false
941
    end)
942
end
943
944
rotmenu=function(plr,speaker)
945
    dmp(speaker)
946
    pc=ps.color(plr)
947
    _tab('Layered',pc,speaker,function()
948
        dmp(speaker)
949
        _tab('Layered flat',pc,speaker,
950
        function(tabc)
951
            dmp(speaker)
952
            ds.set(plr,'rot','lf')
953
            ds.set(plr,'shape','cube')
954
        end)
955
        _tab('Layered rand',pc,speaker,
956
        function(tabc)
957
            dmp(speaker)
958
            ds.set(plr,'rot','lrand')
959
            ds.set(plr,'shape','cube')
960
        end)
961
    end)
962
    _tab('Circle',pc,speaker,function()
963
        dmp(speaker)
964
        _tab('Circle rand',pc,speaker,
965
        function(tabc)
966
            dmp(speaker)
967
            ds.set(plr,'rot','circlerand')
968
            ds.set(plr,'shape','cube')
969
            
970
        end)
971
        _tab('Circle flat',pc,speaker,
972
        function(tabc)
973
            --local e=ds.get(plr)
974
            dmp(speaker)
975
            ds.set(plr,'rot','circleflat')
976
            ds.set(plr,'shape','cube')
977
            --e[6]='circleflat'
978
        end)
979
        _tab('Flat tab',pc,speaker,
980
        function(tabc)
981
            --local e=ds.get(plr)\
982
            dmp(speaker)
983
            ds.set(plr,'rot','flattab')
984
            ds.set(plr,'shape','flat')
985
        end)
986
    end)
987
end
988
989
neonmenu=function(plr,speaker)
990
    local plrc=_plr(plr)if plrc then plr = plrc.Name end
991
    local pc=ps.color(speaker)
992
    dmp(speaker)
993
    _tab('Neon on',pc,speaker,function()
994
        dmp(speaker)
995
        alert.c(speaker~=plr and plr..'\'s neon enabled' or plr..'Neon enabled',pc,speaker)
996
        ds.set(plr,'neon',true)
997
    end)
998
    
999
    _tab('Neon off',pc,speaker,function()
1000
        dmp(speaker)
1001
        alert.c(speaker~=plr and plr..'\'s neon disabled' or plr..'Neon disabled',pc,speaker)
1002
        ds.set(plr,'neon',false)
1003
    end)
1004
end
1005
configtab=function(plr,speaker)
1006
    local plrc=_plr(plr)if plrc then plr = plrc.Name end
1007
	if getrank(speaker.Name)>getrank(plr) and getrank(speaker.Name)>3 or plrc==speaker then
1008
        if plr~=speaker and getrank(speaker)>=4 and plrc then
1009
                _tab('actions','Lime green',speaker,function()plrfunc(plrc,speaker)end)
1010
        end
1011
        local pc=ps.color(plr)
1012
        _tab('Player Configuration','New Yeller',speaker,
1013
        function(tab)
1014
            rem(tab)
1015
            if plr~=speaker and getrank(speaker)>getrank(plr) and getrank(speaker)>=4 or plr==speaker and getrank(speaker)>=3 then
1016
                _tab('Set rank',rank[getrank(plr)],speaker,function()dmp(speaker)changerank(plr,speaker)end)
1017
            end
1018
            _tab('Set wave',pc,speaker,
1019
            function(tab2)
1020
                wavemenu(plr,speaker)
1021
                _tab('Back','Teal',speaker,function()plrmen(plr,speaker)end)
1022
            end)
1023
            _tab('Set rot',pc,speaker,
1024
            function(tab2)
1025
                rotmenu(plr,speaker)
1026
                _tab('Back','Teal',speaker,function()plrmen(plr,speaker)end)
1027
            end)
1028
            _tab('Set color',pc,speaker,
1029
            function()
1030
                dmp(speaker)
1031
                _tab('Back','Teal',speaker,function()plrmen(plr,speaker)end)
1032
                _tab('Select a color',pc,speaker)
1033
                for i,v in pairs(colors)do
1034
                    _tab('['..v..']',v,speaker,
1035
                    function()
1036
                    local e=ds.get(plr)
1037
                    e[4]=v
1038
                    ds.set(plr,'color',v)
1039
                    alert.c('Your color is now '..v,v,plrc)
1040
                    if plrc~=speaker then
1041
                        alert.c('You set '..tostring(plr)..'\'s color to '..v,ps.color(speaker),speaker)
1042
                    end
1043
                    plrmen(plr,speaker)end)
1044
                end
1045
                
1046
            end)
1047
            _tab('Set Neon',pc,speaker,
1048
            function()
1049
                neonmenu(plr,speaker)
1050
            end)
1051
        end)
1052
        
1053
    end
1054
end
1055
1056
plrmen=function(plr,speaker,ccc)
1057
    dmp(speaker)
1058
    _dmtab(speaker)
1059
    --ct('Back','Teal',ccc,speaker)
1060
    local plrc=_plr(plr)
1061
    if plrc==nil then else plr=plrc.Name end
1062
    local pc=ps.color(plr)
1063
    _tab(plr,n,speaker)
1064
    local v=ds.prof(plr)
1065
    _tab('Rank:\n'..getrank(plr),pc,speaker)
1066
    if v then
1067
    _tab('Reason:\n'..v[3],pc,speaker)
1068
    _tab('Color:\n'..v[5],v[5],speaker)
1069
    _tab('Wave:\n'..tostring(ps.wave(v[1])),v[5],speaker)
1070
    end
1071
    if plrc then _tab('age:\n'..tostring(plrc.AccountAge),pc,speaker)end
1072
    _tab('color:\n'..ps.color(plr),pc,speaker)
1073
    local nr=ds.default(ds.prof(plr))nr=not nr
1074
    _tab('stored in users:\n'..str.firstc(tostring(nr)),pc,speaker)
1075
    configtab(plrc,speaker)
1076
    
1077
    
1078
    
1079
    
1080
end
1081
1082
assettype=function(id)
1083
    local i=game:GetService("MarketplaceService"):GetProductInfo(tonumber(id))
1084
    return i.AssetTypeId
1085
end
1086
plrinfo=function(plr,speaker)
1087
    plr=_plr(plr)
1088
    dmp(speaker)
1089
    _dmtab(speaker)
1090
    
1091
end
1092
1093
getAllArgs=function(str)
1094
	local found={}
1095
	local runw=true
1096
	while runw do
1097
		local arg,ends=getargb(str)
1098
		--print(ends)
1099
		if arg~='' and ends~=0 then
1100
			table.insert(found,arg)
1101
			str=str:sub(ends+1)
1102
		else
1103
			runw=false
1104
		end
1105
	end
1106
	if found~={}then
1107
	return found end
1108
end
1109
1110
songmenu=function(n,speaker)
1111
    dmp(speaker)
1112
    
1113
    if type(n)==type('hi')then
1114
        n=music[n][1]
1115
    end if not n then return end
1116
    _dmtab(speaker)
1117
    local i=game:GetService("MarketplaceService"):GetProductInfo(tonumber(n))
1118
    name=i.Name
1119
    t.t("Name: "..i.Name, "Hot pink",speaker)
1120
    t.t("Sales: "..i.Sales, "New Yeller",speaker)
1121
    t.t("Id: "..i.AssetId,'Deep orange',speaker)
1122
    local inlib=false
1123
    for i,v in pairs(music)do
1124
        if v[1]==i.AssetId then
1125
            music[i]=nil inlib=true
1126
        end
1127
    end
1128
    if inlib then music[i.Name]={i.AssetId,'Downloaded'}end
1129
    _tab("Play sound", 'Lime green',speaker,
1130
    function()
1131
        dmp(speaker)
1132
        chat("sm'deep",speaker)
1133
        m.play(nil,true)
1134
        m.play(tonumber(i.AssetId))
1135
        alert.c('now playing:\n'..i.Name,'Lime green',speaker,3)
1136
    end)
1137
    if (getrank(speaker.Name)<4) then return end            
1138
    if music[i.Name]then
1139
        _tab("Remove from library",'Bright red',speaker,
1140
        function()
1141
            local mz=m.getlib()
1142
            mz[i.Name]=nil
1143
            m.setlib(mz)
1144
            alert.c('Removed song','Really red',speaker,4)
1145
        end,'dmself')
1146
    else
1147
        _tab("Add to library",'Teal',speaker,
1148
        function()
1149
            m.addsong(i.Name,tonumber(i.AssetId),'Downloaded')
1150
            music[i.Name]={i.AssetId,'Downloaded'}
1151
            alert.c('Added song','Teal',speaker,4)
1152
        end,'dmself')
1153
    end
1154
end
1155
1156
genrelist=function(speaker,genreq)
1157
    local genres={}
1158
    for i,v in pairs(music)do
1159
        if v[2]~=nil then
1160
            local g=v[2]:lower()
1161
            g=g:sub(1,1):upper()..g:sub(2)
1162
            if not genres[g]then genres[g]={}end
1163
            table.insert(genres[g],i)
1164
        else
1165
            if not genres['Uncategorized']then genres['Uncategorized']={}end
1166
            table.insert(genres['Uncategorized'],i)
1167
        end
1168
    end
1169
    _dmtab(speaker)
1170
    if genreq == nil then
1171
        for i,v in pairs(genres)do--name , table of names
1172
            local g=genres[i]--table of stuff
1173
            if i=='Downloaded'and #v==0 then else
1174
                local ccc=c.purple
1175
                if i=='Downloaded'then
1176
                    ccc='Lime green'
1177
                end
1178
                _tab(i..' ['..#g..']',ccc,speaker,
1179
                function()
1180
                    dmp(speaker)
1181
                    _dmtab(speaker)
1182
                    _tab('['..i..']',c.purple,speaker)
1183
                    for k,z in pairs(g)do
1184
                        songmenu(z,speaker)
1185
                    end
1186
                end)
1187
            end
1188
        end
1189
    else
1190
        if genres[genreq]~=nil then
1191
            local req=genres[genreq]
1192
            local ccc=c.purple
1193
            if i=='Downloaded'then
1194
                ccc='Lime green'
1195
            end
1196
            for k,z in pairs(req)do
1197
                songmenu(z,speaker)
1198
            end
1199
        end
1200
    end
1201
end
1202
t.t=function(text,color,player,t)
1203
    t=t or 0
1204
    if not text or not color or not player then return end
1205
    local plr=_plr(player)
1206
    _tab(text,color,plr,'','',t)
1207
end
1208
1209
settime=function(t)
1210
    game:service'Lighting'.TimeOfDay=t
1211
end
1212
1213
ct=function(txt,color,chatm,plr,flag)
1214
    _tab(txt,color,plr,function()chat(chatm,plr)end,flag)
1215
end
1216
1217
iscmd=function(str)
1218
    for i,v in pairs(cmds)do
1219
        if v.NAME:lower()==str:lower() or aliasof((c.ALIAS or {}),str)then return v end
1220
    end
1221
end
1222
chat=function(msg,plr)--obj
1223
    if not enabled then return end
1224
    local iscmd=false
1225
    logs.cwrite(plr.Name..': '..msg)
1226
    if msg:sub(1,3)=='/e 'then msg=msg:sub(4)iscmd=true end
1227
    if msg:sub(1,string.len(getbet()))==getbet() then msg=msg:sub((string.len(getbet()))+1)iscmd=true end
1228
    if not iscmd then return end
1229
	local base,ends=getbase(msg)
1230
    logs.cwrite(plr.Name..': '..msg)
1231
	local cmd=nil;
1232
    local test=playertimes[plr.Name]
1233
    if not test then playertimes[plr.Name]=tick()end
1234
    
1235
    if tick()-playertimes[plr.Name]<.4 then return end
1236
    playertimes[plr.Name]=tick()
1237
	if base then
1238
		for i,c in pairs(cmds)do
1239
			if c.NAME:lower()==base:lower() or aliasof(c.ALIAS,base)then
1240
				local cmd=c;
1241
				local arg=getAllArgs(msg:sub(ends))
1242
                local rc=ps.islocked(c.NAME,plr)
1243
				if hasPermission(plr,c.PERM)and not rc then
1244
					--print(arg[1])
1245
					local run,error=ypcall(function()
1246
						c.FUNC(plr,arg,msg)
1247
    				end)
1248
    				if not run then dmp(plr)alert.c('Error','White',plr)alert.c(error,'Really red',plr) end
1249
                elseif rc then
1250
                    alert.c('This command has been locked for you!','Really red',plr)
1251
                else
1252
                    alert.c('You do not have permission for that command! ['..c.PERM..']','Really red',plr)
1253
				end
1254
			end
1255
		end
1256
	end
1257
end
1258
1259
addcmd=function(name,desc,permission,args,fn,aliases)
1260
1261
--COMMAND NAME
1262
1263
--COMMAND DESCRIPTION
1264
1265
--MINIMUM PERMISSION LEVEL
1266
1267
--ARGS
1268
1269
--FUNCTION (SPEAKER, ARGS)
1270
1271
--ALIAS TABLE (OPTIONAL)
1272
1273
aliases=aliases or {}
1274
1275
table.insert(cmds,{
1276
NAME  =name;
1277
DESC  =desc;
1278
PERM  =permission;
1279
ARGS  =args;
1280
FUNC  =fn;
1281
ALIAS =aliases;
1282
})
1283
end
1284
1285
runas=function(msg,plr)
1286
	chat(msg,plr)
1287
end
1288
1289
1290
cmdmenu=function(v,speaker)
1291
    _tab((v.NAME),ps.color(speaker),speaker,
1292
	function()
1293
		dmp(speaker)
1294
        _dmtab(speaker)
1295
        t.t(v.NAME,c.cmdc,speaker)
1296
        
1297
        local pc=c.red
1298
        local ps='You can\'t use this'
1299
        
1300
        local r=getrank(speaker)
1301
        
1302
        if r>=v.PERM then pc=c.green ps='You can use this!'end
1303
        t.t('Permission: '..v.PERM,c.white,speaker)
1304
        t.t(ps,pc,speaker)
1305
		t.t(v.DESC,c.white,speaker)
1306
		if v.ALIAS[1]~=nil then
1307
			_tab('Aliases: '..list(v.ALIAS),c.white,speaker)
1308
		end
1309
		
1310
	end)
1311
end
1312
1313
getCommandsWithPerm=function(num)
1314
    local found={}
1315
    for i,v in pairs(cmds)do
1316
		if v.PERM<=num then
1317
			table.insert(found,v)
1318
		end
1319
	end
1320
    return found
1321
end
1322
1323
addcmd('cmds','show commands',0,1,
1324
function(speaker,a,o)
1325
	dmp(speaker)
1326
    local r=getrank(speaker)
1327
    local s=speaker
1328
    local pc=ps.color(speaker)
1329
    _dmtab(speaker)
1330
    _tab('Your rank: '..r,pc,speaker,
1331
    function()
1332
        dmp(speaker)
1333
        local z=getCommandsWithPerm(getrank(speaker))
1334
        _dmtab(speaker)
1335
        ct('Go back','Teal','cmds',speaker)
1336
        for i,v in pairs(z)do
1337
            cmdmenu(v,speaker)
1338
        end
1339
    end)
1340
    
1341
    for i=0,5 do
1342
        _tab(i..' ['..(rank[i] or 'guest')..']',pc,speaker,
1343
        function()
1344
            dmp(speaker)
1345
            _dmtab(speaker)
1346
            local z=getCommandsWithPerm(i)
1347
            ct('Go back','Teal','cmds',speaker)
1348
            for i,v in pairs(z)do
1349
                cmdmenu(v,speaker)
1350
            end
1351
        end)
1352
    end
1353
    _tab('View all',pc,speaker,
1354
    function()
1355
        dmp(speaker)
1356
        _dmtab(speaker)
1357
        local z=getCommandsWithPerm(10)
1358
        ct('Go back','Teal','cmds',speaker)
1359
        for i,v in pairs(z)do
1360
            cmdmenu(v,speaker)
1361
        end
1362
    end)
1363
end,{'commands'})
1364
1365
addcmd('ping','output with text\nargs: text to display',0,1,
1366
function(speaker,args)
1367
    if args[1]~=nil and args[2]~=nil and getrank(speaker)>2 and tonumber(args[1]) then
1368
        for i=1,tonumber(args[1])do
1369
            alert.c(args[2]or 'pong',c.white,speaker)
1370
        end
1371
        return
1372
    elseif args[2]~=nil and getrank(speaker)>=2 and _match(args[1],speaker)~={} then 
1373
        local plr=_match(args[1],speaker)
1374
        table.foreach(plr,function(k,v)
1375
        alert.c(args[2] or 'pong!',c.white,_plr(v))end)
1376
    
1377
    else
1378
	alert.c(args[1] or 'pong!',c.white,speaker)
1379
    end
1380
end,
1381
{'print','out'})
1382
1383
addcmd('removesongs','mass library editing',5,0,
1384
function(speaker,args)
1385
    --print(args[2])
1386
    for i,v in pairs(music)do
1387
        _tab(i,c.red,speaker,function(tablet)rem(tablet)music[i]=nil;end)
1388
    end
1389
    _tab('save','Lime green',speaker,function()m.setlib(music)dmp(speaker)alert.c('music library rewritten','White',speaker)end)
1390
end,{})
1391
1392
1393
addcmd('removeusers','mass user editing',5,0,
1394
function(speaker,args)
1395
    --print(args[2])
1396
    for i,v in pairs(users)do
1397
        _tab(v[1],'White',speaker,function(tablet)rem(tablet)table.remove(users,i);end)
1398
    end
1399
    _tab('save','Lime green',speaker,function()ds.save()dmp(speaker)alert.c('user library rewritten','White',speaker)end)
1400
end,{})
1401
1402
1403
addcmd('time','adjust time',4,0,
1404
function(speaker,args)
1405
    _dmtab(speaker)
1406
	_tab('Midnight','Really black',speaker,function()settime(0)dmp(speaker)end)
1407
    _tab('Morning','White',speaker,function()settime(6)dmp(speaker)end)
1408
    _tab('Noon','White',speaker,function()settime(12)dmp(speaker)end)
1409
    _tab('Evening','Really black',speaker,function()settime(18)dmp(speaker)end)
1410
end,
1411
{'timemenu'})
1412
1413
1414
addcmd('dt','dismiss tabs\nargs: player',0,1,
1415
function(speaker,args)
1416
	if args[1]and hasPermission(speaker,{PERM=4})then
1417
        local fplrs=_match(args[1],speaker)
1418
		table.foreach(fplrs,function(ki,vi)dmp(_plr(vi))end)
1419
	else
1420
		dmp(speaker)
1421
	end
1422
end,
1423
{'dismiss','dm'})
1424
1425
addcmd('music','show music list',3,1,--todo id
1426
function(speaker,args)
1427
	dmp(speaker)
1428
    local r=getrank(speaker)
1429
	if args[1]==nil then
1430
        if r>=3 then
1431
            _dmtab(speaker)
1432
            --alert.p(tostring(args[1]),speaker)
1433
            for i,v in pairs(music)do --id,genre
1434
                _tab(i,'Lime green',speaker,
1435
                function()
1436
                    songmenu(v[1],speaker)
1437
                end)
1438
            end
1439
        end
1440
    elseif inTable({'stop','sm'},args[1]:lower())and r>=3 then
1441
        chat("stopmusic"..split..'deep',speaker)
1442
    elseif args[1]:lower()=='id'and args[2]~=nil then
1443
        if not tonumber(args[2])then return end
1444
        songmenu(tonumber(args[2]),speaker)
1445
    elseif args[1]~=nil and r>=3 then
1446
        if tonumber(args[1])~=nil then
1447
            _tab('ID','Hot pink',speaker,function()
1448
                songmenu(tonumber(args[1]),speaker)
1449
            end)
1450
        end
1451
        _dmtab(speaker)
1452
        t.t('showing results for:\n'..args[1],'White',speaker)
1453
        local rzzz=matchtbli(music,tostring(args[1]))
1454
        local mz=m.getlib()
1455
        for kn,zn in pairs(rzzz)do
1456
            
1457
            if mz[zn]==nil then
1458
                local s=music[zn]
1459
                _tab(zn,c.snd,speaker,
1460
                function()
1461
                    dmp(speaker)
1462
                    m.play(s[1])
1463
                    alert.c('now playing:\n'..zn,'Lime green',speaker,3)
1464
                end,'',3)
1465
            end
1466
        end
1467
        
1468
        local searchterm=args[1]
1469
        http=game:GetService'HttpService'
1470
        local url="http://roproxy.tk/catalog/json?Keyword="..http:UrlEncode(searchterm).."&Category=9&ResultsPerPage=20"
1471
        local assets=http:JSONDecode(http:GetAsync(url))
1472
        if #assets==0 then alert.p('no results!',speaker)return else
1473
        
1474
        
1475
        for i,v in pairs(assets)do
1476
            wait()
1477
            local cddd='New Yeller'
1478
            local songcheck=m.getlib()
1479
            if songcheck[v.Name]~=nil then
1480
                cddd='Lime green'
1481
            end
1482
            _tab(v.Name,cddd,speaker,function()
1483
                songmenu(v.AssetId,speaker)
1484
                
1485
                
1486
            end)
1487
        end
1488
        end
1489
    --[[elseif args[1]~=nil and args[2]~=nil then
1490
        if inTable({'l','lib','ls','slib'},args[1]:lower())then
1491
            local r=matchtbli(music,args[2])
1492
            for k,z in pairs(r)do
1493
                local s=music[z]
1494
                _tab(z,c.snd,
1495
                function()
1496
                    dmp(speaker)
1497
                    m.play(s[1])
1498
                    alert.p('now playing: '..z,speaker)
1499
                end,speaker,3)
1500
            end
1501
        end]]
1502
	end
1503
end,
1504
{'snd','snds'})
1505
1506
1507
1508
addcmd('stopmusic','stops music / args: deep',3,1,
1509
function(speaker,args)
1510
    if ALUSND then
1511
    if ALUSND.Parent~=nil then
1512
        ALUSND:Stop()
1513
        ALUSND:remove()
1514
    end
1515
    end
1516
	local g=''
1517
    if args[1]~=nil then
1518
        if type(args[1])=='string'then g=args[1]:lower() end
1519
    end
1520
	if g=='true'or g=='deep'then
1521
		m.stopmusic(workspace,true)
1522
	elseif g=='o'or g=='others'then--team
1523
        m.stopmusico(workspace,true)
1524
    else
1525
		m.play(nil,true)
1526
	end
1527
    if silentmode then return end
1528
    for i,v in pairs(script.Parent:children'')do
1529
        if v.ClassName~=nil then
1530
            if v:IsA'Sound'then v:Stop()v:remove()end
1531
        end
1532
    end
1533
end,
1534
{'sm'})
1535
1536
1537
addcmd('net','show connected players',0,0,
1538
function(speaker,args)
1539
    dmp(speaker)
1540
    for i,v in pairs(plrs:GetPlayers())do
1541
        --local cl=rank[getrank(v.Name)]
1542
        local cl=ps.color(v.Name)
1543
        if cl==nil then cl='White'end
1544
        --if speaker==v then cl=c.snd end
1545
        _tab(v.Name,cl,speaker,function()
1546
            if getrank(speaker)>getrank(v) and getrank(speaker)>3 or speaker==v then
1547
                dmp(speaker)
1548
                local plr=v
1549
                plrmen(v,speaker,'net')
1550
            end
1551
        end)
1552
    end
1553
end,
1554
{'plrs','players'})
1555
1556
addcmd('badtabs','show credits',0,0,
1557
function(speaker)
1558
    dmp(speaker)
1559
    
1560
    print('ALUREON INSTANCE',tostring(ver))
1561
	alert.c('bad tablets v'..ver,'New Yeller',speaker)
1562
	alert.c('your rank: '..getrank(speaker),'New Yeller',speaker)
1563
    _tab('say cmds\' to get your commands','New Yeller',speaker,function()dmp(speaker)chat("cmds",speaker)end,'')
1564
	alert.c('made by badfractions','New Yeller',speaker)
1565
end,
1566
{'cred'})
1567
1568
addcmd('dtall','dismiss all players tabs',4,0,
1569
function()
1570
	for i,v in pairs(tabs)do
1571
		dmp(i)
1572
	end
1573
end,
1574
{'dismissall'})
1575
1576
addcmd('save','saves the stuff',4,0,
1577
function(speaker)
1578
    ds.save()
1579
    alert.c('saved the stuff','Lime green',speaker)
1580
end)
1581
1582
addcmd('fixlighting','Fixes lighting properties',3,0,
1583
function()
1584
	local l=game:service'Lighting'
1585
    l.Ambient=_rgb(178,178,178)
1586
    l.Brightness=1
1587
    l.Outlines=false
1588
    l.TimeOfDay=14
1589
end,
1590
{'fixl'})
1591
1592
promptvote=function(v,q)
1593
	_tab(q,c.snd,v,'','',10)
1594
    _tab('Vote Yes',c.green,v,function()dmp(v)vote.y=vote.y+1;alert.p('Vote counted',v)end,'',10)
1595
    _tab('Vote No','Really red',v,function()dmp(v)vote.n=vote.n+1;alert.p('Vote counted',v)end,'',10)
1596
    _tab('No vote','White',v,function()dmp(v);end,'',10)
1597
end
1598
1599
addcmd('vote','vote\nargs: plr/tp,(yn,k,b)',4,0,
1600
function(speaker,args)
1601
    
1602
	if args[1]~=nil and args[2]~=nil then
1603
		q=args[1]
1604
        vote.y=0;
1605
        vote.n=0;
1606
        local plr=nil
1607
    if args[2]:lower()=='k'then
1608
            plr=_plr(q)
1609
            if plr~=nil then
1610
            	for i,v in pairs(plrs:getPlayers())do
1611
            		promptvote(v,'Vote: Kick '..plr.Name..'?')
1612
            		vote.topic='Kick '..plr.Name..'?'
1613
                    action='k'
1614
        		end
1615
            end
1616
    elseif args[2]:lower()=='b'then
1617
            plr=_plr(q)
1618
            if plr~=nil then
1619
            	for i,v in pairs(plrs:getPlayers())do
1620
            		promptvote(v,'Vote: Ban '..plr.Name..'?')
1621
            		vote.topic='Ban '..plr.Name..'?'
1622
                    action='b'
1623
        		end
1624
            end
1625
       elseif args[2]:lower()=='yn'then
1626
        	for i,v in pairs(plrs:getPlayers())do
1627
            	promptvote(v,'Vote: '..q)
1628
            	vote.topic=q
1629
        	end
1630
        end
1631
    end
1632
    if args[1] ==nil then return end
1633
    if inTable({'view','results','check'},args[1]:lower()) then
1634
    	delay(0,function()
1635
        	if vote.topic~='' then
1636
        		_dmtab(speaker)
1637
        		_tab('Vote results',c.white,speaker)
1638
        		_tab('Topic: '..vote.topic,'Bright blue',speaker)
1639
            	_tab('YES: '..vote.y,c.green,speaker)
1640
            	_tab('NO: '..vote.n,'Really red',speaker)
1641
            	if 1+1==3 and vote.y>vote.n and inTable({'k','b'},action:lower())then
1642
            		_tab('Vote succeeded. Click here to execute.','New Yeller',speaker,
1643
            		function()
1644
            			dmp(speaker)
1645
            			local zz=action:lower()
1646
            			if zz=='k'then
1647
            				Kick(_plr(q))
1648
            				t.c('Kicked player','Really red',speaker,4)
1649
            			elseif zz=='b'then
1650
            				setrank(v.Name,-1)
1651
            				Kick(v)
1652
            				t.c('Banned player','Really red',speaker,4)
1653
            			end;
1654
            		end)
1655
            	end
1656
            end
1657
        end)
1658
    end
1659
end,
1660
{'poll','ballot'})
1661
1662
addcmd('disabletabs','disables tabs',5,0,
1663
function(speaker,args)
1664
	_tab('click to confirm',c.purple,speaker,
1665
	function()
1666
		alert.p('saved all libraries',speaker)
1667
		delay(4,disabletabs)
1668
	end,'dmself',4)
1669
end,
1670
{'stop'})
1671
1672
addcmd('update','updates instance of tabs',5,0,
1673
function(speaker,args)
1674
    update=true
1675
    alert.p('updating',speaker)
1676
    delay(1,disabletabs)
1677
end)
1678
1679
addcmd('shutdown','kills game',5,0,
1680
function(speaker,args)
1681
    for i,v in pairs(plrs:GetPlayers'')do
1682
        Kick(v)
1683
    end
1684
end)
1685
1686
addcmd('newserver','creates new game server at id',5,1,
1687
function(speaker,args)
1688
    if args[1]~=nil then
1689
        local x=nil
1690
        if inTable({'place','here','this','game'},tostring(args[1]))then x=game.PlaceId end
1691
        if x==nil then
1692
            x=tonumber(args[1])
1693
        end
1694
        if x then
1695
            alert.c('Created new server','Lime green',speaker)
1696
            newserver(x)
1697
            
1698
        end
1699
    else
1700
        alert.c('Created new server','Lime green',speaker)
1701
        newserver(game.PlaceId)
1702
    end
1703
end,
1704
{'ns','createserver'})
1705
1706
1707
addcmd('afk','go afk',0,0,
1708
function(speaker,args)
1709
    dmp(speaker)
1710
    for i=1,5 do
1711
        _tab(speaker.Name..' is afk','White',speaker,function()dmp(speaker)end)
1712
    end
1713
end,
1714
{})
1715
1716
1717
addcmd('db','change db_view',5,1,
1718
function(speaker,args)
1719
    if args[1]~=nil then
1720
        if inTable({'true','grid'},args[1]:lower())then
1721
            t.db_view='GRID'
1722
        else
1723
            t.db_view='PLR'
1724
        end
1725
    end
1726
    return
1727
end)
1728
1729
addcmd('rank','changes a players rank',5,3,
1730
function(speaker,args)
1731
    local plr
1732
    local rank
1733
    local reason
1734
    if args[1]then plr=_plr(args[1])end
1735
    if args[2]then rank=tonumber(args[2])end
1736
    if args[3]then reason=args[3]else reason='None'end
1737
    if plr and rank then
1738
        ds.set(plr.Name,'rank',rank)
1739
        ds.set(plr.Name,'reason',reason)
1740
        alert.c('You are now rank '..rank,ps.color(plr.Name),plr)
1741
        alert.c('You set '..plr.Name..'\'s rank to '..rank,ps.color(speaker.Name),speaker)
1742
    end
1743
end)
1744
addcmd('ranked','shows all ranked players',2,0,
1745
function(speaker,args)
1746
    dmp(speaker)
1747
    _dmtab(speaker)
1748
    for i,v in pairs(users)do
1749
        --print(list(v))
1750
        local s=v[1]
1751
        if v[2]==-1 then v[5]='Really black's=s..' (Banned)'end
1752
        if type(v[1])==type('hi')then
1753
        	_tab(v[1],v[5],speaker,
1754
        	function()
1755
        		dmp(speaker)
1756
        		_dmtab(speaker)
1757
        		
1758
        		plrmen(v[1],speaker,'ranked')
1759
        	end)
1760
        end
1761
    end
1762
end)
1763
1764
addcmd('pri','opens pri options',5,0,
1765
function(speaker,args)
1766
    local sss='off'
1767
    local pc=c.red
1768
    if pri then sss='on';pc='Lime green' end
1769
    dmp(speaker)
1770
    _tab('pri is '..sss,pc,speaker)
1771
    _tab((pri and '[DISABLE]') or '[ENABLE]',pri and 'Really red' or 'Lime green',speaker,function()
1772
        dmp(speaker)
1773
        pri=not pri
1774
        if pri then
1775
            for i,v in pairs(plrs:GetPlayers'')do
1776
                if getrank(v.Name)<1 then Kick(v)end
1777
            end
1778
        end
1779
        alert.c('pri was '..(pri and 'enabled' or 'disabled'),c.white,speaker)
1780
    end)
1781
end)
1782
1783
addcmd('jump','makes player jump',3,1,function(speaker,args)
1784
    local fplr=_match(args[1],speaker)
1785
    for i,v in pairs(fplr)do
1786
        safe.r(function()_plr(v).Character.Humanoid.Jump=true;end)
1787
    end
1788
end)
1789
1790
addcmd('rot','changes players rot style',1,1,function(speaker,args)
1791
    local targ=speaker
1792
    
1793
    if args[1]~=nil then
1794
        if _plr(targ)~=nil then targ=_plr(targ)end
1795
    end
1796
    rotmenu(targ,speaker)
1797
end)
1798
1799
addcmd('sit','makes player sit',3,1,function(speaker,args)
1800
    local fplr=_match(args[1],speaker)
1801
    for i,v in pairs(fplr)do
1802
        safe.r(function()_plr(v).Character.Humanoid.Sit=true;end)
1803
    end
1804
end)
1805
1806
addcmd('kill','makes player dead',3,1,function(speaker,args)
1807
    local fplr=_match(args[1],speaker)
1808
    for i,v in pairs(fplr)do
1809
        safe.r(function()_plr(v).Character.Head:remove()end)
1810
    end
1811
end)
1812
1813
addcmd('fling','next plane to china',4,1,function(speaker,args)
1814
    local fplr=_match(args[1],speaker)
1815
    for i,v in pairs(fplr)do
1816
        safe.r(function()_plr(v).Character.Humanoid.Sit=true;_plr(v).Character.Torso.Velocity=v3(4000,4000,4000)end)
1817
    end
1818
end)
1819
1820
addcmd('god','makes player godly',3,1,function(speaker,args)
1821
    local fplr=_match(args[1],speaker)
1822
    for i,v in pairs(fplr)do
1823
        safe.r(function()_plr(v).Character.Humanoid.MaxHealth=math.huge;end)
1824
    end
1825
end)
1826
1827
addcmd('kick','makes player gone',4,1,function(speaker,args)
1828
    local fplr=_match(args[1],speaker)
1829
    for i,v in pairs(fplr)do
1830
        safe.r(function()Kick(_plr(v));end)
1831
    end
1832
end)
1833
1834
addcmd('ban','makes player gone forever',5,2,function(speaker,args)
1835
    local fplr=_plr(args[1])if not fplr then return end
1836
    if getrank(fplr.Name)<getrank(speaker.Name)then
1837
        if args[2]~=nil then ds.set(fplr,'reason',args[2])end
1838
        safe.r(function()setrank(fplr,-1)Kick(_plr(fplr));end)
1839
    end
1840
end)
1841
1842
addcmd('menu','opens menu',4,1,function(speaker,args)
1843
    dmp(speaker)
1844
    local pc=ps.color(speaker)
1845
    _tab('music','Lime green',speaker,function()
1846
        chat('music',speaker)
1847
    end)
1848
    _tab('players','Bright blue',speaker,function()
1849
        chat('net',speaker)
1850
    end)
1851
    _tab('logs','Bright yellow',speaker,function()
1852
        chat('logs',speaker)
1853
    end)
1854
    _tab('settings',ps.color(speaker),speaker,function()
1855
        dmp(speaker)
1856
        _tab('rotation',pc,speaker,function()rotmenu(speaker,speaker)end)
1857
        _tab('neon',pc,speaker,function()neonmenu(speaker,speaker)end)
1858
    end)
1859
end)
1860
1861
addcmd('silent','puts script in silent mode',5,0,
1862
function()
1863
	silentmode=true
1864
    for i,v in pairs(plrs:GetPlayers'')do
1865
        dmp(v)
1866
    end
1867
    script=nil
1868
    logs.write'silent mode active'
1869
end)
1870
1871
addcmd('set','sets plr attribute',5,3,
1872
function(speaker,args)
1873
    --plr att val
1874
    if args[1]~=nil and args[2]~=nil and args[3]~=nil then
1875
        local plr=_plr(args[1])
1876
        if not plr then plr=args[1] else plr=plr.Name end
1877
        local ind=tostring(args[2]):lower()
1878
        local val=args[3]
1879
        if plr and ind and inTable(ds.props,ind)then 
1880
            ds.set(plr,ind,val)
1881
            alert.c('set '..plr..'\'s '..ind..' to '..tostring(val),'White',speaker,4)
1882
        end
1883
    end
1884
end,
1885
{'setr'})
1886
1887
addcmd('lcmd','sets locked for a player',5,2,
1888
function(speaker,args)
1889
    
1890
    if args[1]~=nil and args[2]~=nil then
1891
        dmp(speaker)
1892
        local cplr=_plr(args[1])
1893
        if not cplr then return end
1894
        if iscmd(args[2])~=nil then
1895
            local c=iscmd(args[2])
1896
            if ps.islocked(c.NAME,cplr)then
1897
                _tab(c.NAME..' is LOCKED','Really red',speaker)
1898
                _tab('Click to unlock','Lime green',speaker,function()
1899
                    for i,v in pairs(users)do
1900
                        if v[1]==cplr.Name then
1901
                            for o,b in pairs(v[7])do
1902
                                if b:lower()==c.NAME:lower()then table.remove(v[7],o) end
1903
                            end
1904
                        end
1905
                    end
1906
                    dmp(speaker)
1907
                    alert.c(c.NAME..' was unlocked for '..cplr.Name,'White',speaker,4)
1908
                end)
1909
            else
1910
                _tab(c.NAME..' is UNLOCKED','Lime green',speaker)
1911
                _tab('Click to lock','Really red',speaker,function()
1912
                    safe.r(function()
1913
                    table.insert(ds.prof(cplr.Name)[7],c.NAME)
1914
                    end)
1915
                    dmp(speaker)
1916
                    alert.c(c.NAME..' was locked for '..cplr.Name,'White',speaker,4)
1917
                end)
1918
            end
1919
        elseif args[2]:lower()=='-list'then
1920
            for i,v in pairs(ds.prof(cplr.Name)[7])do
1921
                _tab(v,'Really red',speaker,function()
1922
                    chat("lcmd'"..cplr.Name.."'"..v,speaker)
1923
                end)
1924
            end
1925
        elseif args[2]:lower()=='-clear'then
1926
            ds.prof(cplr.Name)[7]={}
1927
        end
1928
    end
1929
end,
1930
{'lockcmd','cmdlock','commandlock'})
1931
1932
addcmd('exe','executes a script',5,1,
1933
function(speaker,args,orig)
1934
    orig=orig:sub(5)
1935
    local x=nil
1936
    local success,error=ypcall(function()x={loadstring(orig)}end)
1937
    local func,err=unpack(x);
1938
    alert.c(func(),'White',speaker)
1939
    if success then
1940
        alert.c('Script ran successfully','Lime green',speaker)alert.c(error,'White',speaker)
1941
    else
1942
        alert.c(error,c.red,speaker)
1943
    end
1944
end)
1945
1946
addcmd('songrequest','request a song',0,1,
1947
function(speaker,args)
1948
    dmp(speaker)
1949
    if args[1]~=nil then
1950
        local idz=args[1]
1951
        if not tonumber(idz)then alert.c('Please request a song ID!','Really red',speaker)return end
1952
        if assettype(tonumber(idz))~=3 then alert.c('Please request a song ID!','Really red',speaker)return end
1953
        local izz=game:GetService("MarketplaceService"):GetProductInfo(tonumber(idz))
1954
        _tab("Request \""..izz.Name..'"?','New Yeller',speaker)
1955
        _tab('Yes','Lime green',speaker,function()if inTable(songrequests, tonumber(idz))then dmp(speaker)alert.c('Song is already in request list!','Really red',speaker)else dmp(speaker)table.insert(songrequests,idz)alert.c('Song requested.','Lime green',speaker)end end)
1956
        _tab('Cancel','Really red',speaker,function()dmp(speaker)end)
1957
    end
1958
end,{'requestsong','request'})
1959
1960
addcmd('requests','view song requests',3,0,
1961
function(speaker,args)
1962
    dmp(speaker)
1963
    for i,v in pairs(songrequests)do
1964
        local izz=game:GetService("MarketplaceService"):GetProductInfo(tonumber(v))
1965
        _tab(izz.Name,'Lime green',speaker,
1966
        function()
1967
            dmp(speaker)
1968
            songmenu(tonumber(v),speaker)
1969
            _tab('Reject','Bright red',speaker,
1970
            function()
1971
                songrequests[i]=nil
1972
                chat('requests',speaker)
1973
            end)
1974
        end)
1975
    end
1976
end)
1977
addcmd('logs','view logs',4,0,
1978
function(speaker)
1979
    dmp(speaker)
1980
    _tab('view system logs','New Yeller',speaker,function()
1981
        dmp(speaker)
1982
        _dmtab(speaker)
1983
        table.foreach(logs.LOG,function(k,v)
1984
            t.t(v,'White',speaker)
1985
        end)
1986
    end)
1987
    
1988
    _tab('view chat logs','Bright blue',speaker,function()
1989
        dmp(speaker)
1990
        _dmtab(speaker)
1991
        table.foreach(logs.CLOG,function(k,v)
1992
            t.t(v,'White',speaker)
1993
        end)
1994
    end)
1995
    _tab('clear system logs','White',speaker,function(tablet)
1996
        rem(tablet)
1997
        t.t('system logs cleared','White',speaker)
1998
    end)
1999
    _tab('clear chat logs','White',speaker,function(tablet)
2000
        rem(tablet)
2001
        t.t('chat logs cleared','White',speaker)
2002
    end)
2003
end)
2004
2005
plrs.PlayerAdded:connect(function(plr)
2006
	if not enabled or update then return end
2007
	delay(0,function()repeat wait(1)until plr.Character
2008
    if inTable(banlist,plr.Name)then
2009
		Kick(plr)
2010
		alert.g((plr.Name..' tried to join the game'),3)
2011
        return
2012
	end
2013
    local xx=0
2014
    if datastores then
2015
        xx=getrank(plr.Name)
2016
        if xx==-1 or pri and getrank(plr.Name)==0 then
2017
            Kick(plr)
2018
            --alert.g((plr.Name..' tried to join the game'),3)
2019
            return
2020
        end
2021
        
2022
	end
2023
	
2024
	
2025
    delay(.5,function()
2026
    alert.c('bad tablets v'..ver..' running','New Yeller',plr,4)
2027
	alert.c('your rank: '..getrank(plr),'New Yeller',plr,4)
2028
    _tab('say cmds\' to get your commands','New Yeller',plr,function()dmp(plr)chat("cmds",plr)end,'',4)
2029
    alert.g((plr.Name..' connected'),4)
2030
    end)end)
2031
	
2032
	
2033
	updateevents()
2034
2035
end)
2036
2037
plrs.PlayerRemoving:connect(function(x)
2038
    if enabled and not update then
2039
    local xx=0;
2040
    if datastores and x then
2041
    	
2042
        xx=getrank(x.Name)
2043
    end
2044
    if xx==-1 then
2045
    
2046
    elseif pri and xx==0 then
2047
    alert.g((x.Name..' attempted to join'),4)
2048
    else
2049
	alert.g((x.Name..' disconnected'),4)
2050
    end
2051
	updateevents()
2052
    end
2053
end)
2054
startuptime=elapsedTime()
2055
for i,plr in pairs(plrs:GetPlayers())do
2056
    
2057
    if tonumber(getrank(plr))>=5 then
2058
	alert.c('bad tablets v'..ver..' running','New Yeller',plr,4)
2059
	alert.c('took '..tostring(startuptime/1000)..' seconds to start','Lime green',plr,4)
2060
	alert.c('your rank: '..getrank(plr),'New Yeller',plr,4)
2061
    _tab('say cmds\' to get your commands','New Yeller',plr,function()dmp(plr)chat("cmds",plr)end,'',4)
2062
    end
2063
    if getrank(plr)==-1 or inTable(banlist,plr.Name)then Kick(plr) end
2064
end
2065
2066
2067
alert.g('youre an admin!',4)
2068
updateevents()
2069
2070
local function QuaternionFromCFrame(cf)
2071
	local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components();
2072
	local trace = m00 + m11 + m22 if trace > 0 then 
2073
		local s = math.sqrt(1 + trace);
2074
		local recip = 0.5/s;
2075
		return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5;
2076
	else 
2077
		local i = 0;
2078
		if m11 > m00 then 
2079
			i = 1;
2080
		end;
2081
		if m22 > (i == 0 and m00 or m11) then
2082
			i = 2 end if i == 0 then
2083
			local s = math.sqrt(m00-m11-m22+1);
2084
			local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip; 
2085
		elseif i == 1 then
2086
			local s = math.sqrt(m11-m22-m00+1);
2087
			local recip = 0.5/s;
2088
			return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip ;
2089
		elseif i == 2 then
2090
			local s = math.sqrt(m22-m00-m11+1);
2091
			local recip = 0.5/s;
2092
			return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip;
2093
		end;
2094
	end; 
2095
end;
2096
2097
local function QuaternionToCFrame(px, py, pz, x, y, z, w)
2098
	local xs, ys, zs = x + x, y + y, z + z;
2099
	local wx, wy, wz = w*xs, w*ys, w*zs;
2100
	local xx = x*xs;
2101
	local xy = x*ys;
2102
	local xz = x*zs;
2103
	local yy = y*ys;
2104
	local yz = y*zs;
2105
	local zz = z*zs;
2106
	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)) 
2107
end;
2108
2109
local function QuaternionSlerp(a, b, t)
2110
	local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4];
2111
	local startInterp, finishInterp; 
2112
	if cosTheta >= 0.0001 then
2113
		if (1 - cosTheta) > 0.0001 then
2114
			local theta = math.acos(cosTheta);
2115
			local invSinTheta = 1/math.sin(theta);
2116
			startInterp = math.sin((1-t)*theta)*invSinTheta;
2117
			finishInterp = math.sin(t*theta)*invSinTheta;
2118
		else
2119
			startInterp = 1-t finishInterp = t;
2120
		end;
2121
	else 
2122
		if (1+cosTheta) > 0.0001 then
2123
			local theta = math.acos(-cosTheta);
2124
			local invSinTheta = 1/math.sin(theta);
2125
			startInterp = math.sin((t-1)*theta)*invSinTheta;
2126
			finishInterp = math.sin(t*theta)*invSinTheta;
2127
		else startInterp = t-1 finishInterp = t;
2128
		end;
2129
	end;
2130
	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;
2131
end;
2132
2133
function CLerp(a,b,t)
2134
	local qa={QuaternionFromCFrame(a)};
2135
	local qb={QuaternionFromCFrame(b)};
2136
	local ax,ay,az=a.x,a.y,a.z;
2137
	local bx,by,bz=b.x,b.y,b.z;
2138
	local _t=1-t;
2139
	return QuaternionToCFrame(_t*ax+t*bx,_t*ay+t*by,_t*az+t*bz,QuaternionSlerp(qa, qb, t));
2140
end
2141
2142
2143
2144
2145
2146
spawn(function()
2147
    local rot = 0
2148
    while enabled do
2149
        rot = rot + .001
2150
        for i,v in pairs(tabs)do
2151
            if plrs:FindFirstChild(i)then else
2152
                for o,b in pairs(v)do
2153
                    rem(b)
2154
                end
2155
                tabs[i]=nil
2156
            end
2157
        end
2158
        for Index, Player in pairs(Players:GetPlayers()) do
2159
            if not tabs[Player.Name]then tabs[Player.Name]={}end
2160
            pcall(function()
2161
                for x = 1, #tabs[Player.Name] do
2162
                    if tabs[Player.Name][x] == nil or tabs[Player.Name][x].Parent == nil or tabs[Player.Name][x].Name=='x' or tabs[Player.Name][x].Name == nil or plrs[Player.Name]==nil then
2163
                        table.remove(tabs[Player.Name], x)
2164
                    end
2165
                end
2166
            end)
2167
            local rotstylez=ds.get(Player.Name,'rot')
2168
            local bt=0
2169
            if datastores then if ps.wave(Player.Name)==true then bt=1 end end
2170
            
2171
            
2172
            local tn=#tabs[Player.Name]
2173
            if rotstylez:sub(1,1)=='l'then
2174
                for x = 1, #tabs[Player.Name] do--------------------------------------------------------------------------------* CFrame.Angles(0, math.rad(360 / #tabs[Player.Name])---------------------------------- * CFrame.new(-5 - (1.2 * #tabs[Player.Name]), math.sin(tick()), 0)
2175
                    local tb=tabs[Player.Name][x]
2176
                    
2177
                    if Player.Character.Parent~=nil then if Player.Character:FindFirstChild'Torso' then
2178
                        facet=6
2179
                        
2180
                        local cftp=CFrame.new(Player.Character.Torso.Position)
2181
                        local ddr=((#tabs-(#tabs%facet))/facet)+(#tabs%facet)
2182
                        local meg=x
2183
                        repeat meg=meg-facet ddr=ddr+1 until meg<facet if meg>0 then ddr=ddr+1 end
2184
                        local megic =CFrame.Angles(0,math.rad((360/facet)*(x%facet)+rot*600),0)
2185
                        local tp=CFrame.new(Player.Character.Torso.Position+(megic.lookVector*ddr*6))
2186
                        local mst=math.sin(tick())
2187
                        local mct=math.cos(tick())
2188
                        local rx = mst
2189
                        local ry = mct
2190
                        local rz = 0
2191
                        if rotstylez=='lrand' then tp=tp*CFrame.Angles(rx,ry,rz)end
2192
                        if tb.Name~='x'then
2193
                            tb.CFrame = CLerp(tb.CFrame, tp , .25)
2194
                        end
2195
                    end;end
2196
                end
2197
            else
2198
                for x = 1, tn do--------------------------------------------------------------------------------* CFrame.Angles(0, math.rad(360 / #tabs[Player.Name])---------------------------------- * CFrame.new(-5 - (1.2 * #tabs[Player.Name]), math.sin(tick()), 0)
2199
                    if Player.Character then if Player.Character:FindFirstChild'Torso'~=nil then
2200
                        local cftp=CFrame.new(Player.Character.Torso.Position)
2201
                        local tb=tabs[Player.Name][x]
2202
                        local radius=1.4*((tn)*.4)+4;
2203
                        local rzz=(360/tn)*x
2204
2205
                        
2206
                        local xp=math.cos(((x/tn)-tn*2)*2*math.pi)*radius
2207
                        local yp = math.sin(tick()/math.pi+((x)*bt))
2208
                        local zp=math.sin(((x/tn)-tn*2)*2*math.pi)*radius--(math.sin((x/tn-(tn)+rot)*math.pi*2)*radius)
2209
                        local mst=math.sin(tick())
2210
                        local mct=math.cos(tick())
2211
                        local rx = mst
2212
                        local ry = mct
2213
                        local rz = 0
2214
                        local tp=cftp*CFrame.Angles(0,rot,0)*(CFrame.new(xp,yp,zp):inverse())--:toWorldSpace(CFrame.new(xp,yp,zp):inverse())--*CFrame.Angles(math.pi/180*2,math.pi/180*2,math.pi/180*2);
2215
                        
2216
                        if rotstylez=='circlerand'then tp=tp*CFrame.Angles(rx,ry,0)end
2217
                        if rotstylez=='flattab'then tp=tp*CFrame.Angles(0,-math.rad(rzz),0.4)end
2218
                        if tb.Name~='x'then
2219
                            tb.CFrame = CLerp(tb.CFrame, tp , .25)
2220
                        else
2221
                            tb.CFrame = CLerp(tb.CFrame, cftp , .25)
2222
                        end
2223
                    end;end
2224
                end
2225
            end
2226
        end
2227
        wait()
2228
    end    
2229
end)
2230
2231
coroutine.wrap(
2232
function()
2233
    while wait(20)do
2234
        ds.save()
2235
        table.sort(music,
2236
        function(a,b)
2237
            if a[1]<b[1] then return false end
2238
        end)
2239
    end
2240
end)()
2241
--[[
2242
end]]
2243
2244
2245
--[[remmy=false
2246
function removeothermusic()
2247
	remmy=true
2248
	while remmy do
2249
		wait(2)
2250
		m.stopmusico(workspace,true)
2251
	end
2252
end]]
2253
print(magiclaxnoob)
2254
loadmodule=function(link)
2255
	local run,error=ypcall(function()
2256
        local SHttp = game:GetService("HttpService")
2257
        loadstring(SHttp:GetAsync(link,true) ) ()
2258
        wait(.05)
2259
    end)
2260
    if not run then print(error) end
2261
end
2262
repeat wait()until not enabled
2263
print'bad tabs disabled'
2264
2265
2266
delay(0,function()
2267
    if update then
2268
        local run,error=ypcall(function()
2269
            local Link = me
2270
            local SHttp = game:GetService("HttpService")
2271
            loadstring(SHttp:GetAsync(Link,true) ) ()
2272
            wait(.05)
2273
        end)
2274
        if not run then print(error) end
2275
    end
2276
end)
2277
wait(2)
2278
--]]