Advertisement
Jefferz

duck

Mar 29th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 45.29 KB | None | 0 0
  1. _G,_VERSION,assert,collectgarbage,dofile,error,getfenv,getmetatable,ipairs,load,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,xpcall,coroutine,math,string,table,game,Game,workspace,Workspace,delay,Delay,LoadLibrary,printidentity,Spawn,tick,time,version,Version,Wait,wait,PluginManager,crash__,LoadRobloxLibrary,settings,Stats,stats,UserSettings,Enum,Color3,BrickColor,Vector2,Vector3,Vector3int16,CFrame,UDim,UDim2,Ray,Axes,Faces,Instance,Region3,Region3int16=_G,_VERSION,assert,collectgarbage,dofile,error,getfenv,getmetatable,ipairs,load,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,xpcall,coroutine,math,string,table,game,Game,workspace,Workspace,delay,Delay,LoadLibrary,printidentity,Spawn,tick,time,version,Version,Wait,wait,PluginManager,crash__,LoadRobloxLibrary,settings,Stats,stats,UserSettings,Enum,Color3,BrickColor,Vector2,Vector3,Vector3int16,CFrame,UDim,UDim2,Ray,Axes,Faces,Instance,Region3,Region3int16
  2. math.randomseed(tick())
  3.  
  4.  
  5. --local print = require(game:GetService("ReplicatedStorage"):WaitForChild("OCServer").PrintFunction)
  6. local Workspace = Game:GetService('Workspace')
  7. local Players = Game:GetService('Players')
  8. local ReplicatedStorage = game:GetService('ReplicatedStorage')
  9. local HttpService = game:GetService('HttpService')
  10. local ServerScriptService = game:GetService('ServerScriptService')
  11. local ServerStorage = game:GetService('ServerStorage')
  12. local StarterPack = Game:GetService('StarterPack')
  13. local StarterGui = Game:GetService('StarterGui')
  14. local Lighting = Game:GetService('Lighting')
  15. local Debris = Game:GetService('Debris')
  16. local Teams = Game:GetService('Teams')
  17. local BadgeService = Game:GetService('BadgeService')
  18. local InsertService = Game:GetService('InsertService')
  19. local Terrain = Workspace.Terrain
  20. local RunService = Game:GetService('RunService')
  21. local Soundscape = Game:GetService('SoundService')
  22. local TeleportService = Game:GetService('TeleportService')
  23. local ChatService = Game:GetService('Chat')
  24.  
  25. local ColorMeta = {
  26.     __add = function(v1,v2)
  27.         if (not v2 or not v2) then return end
  28.         if (not v1[1] or not v1[2] or not v1[3] or not v2[1] or not v2[2] or not v2[3]) then return end
  29.         return Color3.new((v1[1]+v2[1])%1,(v1[2]+v2[2])%1,(v1[3]+v2[3])%1)
  30.     end,
  31.     __sub = function(v1,v2)
  32.         if (not v2 or not v2) then return end
  33.         if (not v1[1] or not v1[2] or not v1[3] or not v2[1] or not v2[2] or not v2[3]) then return end
  34.         return Color3.new(math.max(0,v1[1]-v2[1]),math.max(0,v1[2]-v2[2]),math.max(0,v1[3]-v2[3]))
  35.     end
  36. }
  37.  
  38. local custom = {
  39.     {'Howamisupposedtoknow',3}, -- [name, rank] (3 is highest rank, 2 is friends, 1 is temp admin, and 0 is normal player, and <= -1 is banned
  40.     {'PlayerName',2},
  41.     {'cxcharlie',3},
  42. }
  43.  
  44. local LIST = setmetatable({},{
  45.     __index = function(self,index)
  46.         for _,v in pairs(self) do
  47.             if string.lower(v.Name) == string.lower(tostring(index)) then
  48.                 return v
  49.             end
  50.         end
  51.     end,
  52.    
  53.     __newindex = function(self,index,value)
  54.         if value.Rank > 3 then
  55.             value.Rank = 3 -- -_-
  56.             print('really?')
  57.             rawset(self,index,value)
  58.         else
  59.             rawset(self,index,value)
  60.         end
  61.     end,
  62.     }
  63. )
  64.    
  65. function addPlayer(name,rank)
  66.     local new = {Name = name, Rank = rank}
  67.     rawset(LIST,name,new) --if needed there's a return :P
  68. end
  69.  
  70. function getRank(name)
  71.     if LIST[name] then
  72.         return LIST[name].Rank
  73.     else
  74.         return 0
  75.     end
  76. end
  77.  
  78. for index,derp in pairs(custom) do pcall(function() addPlayer(derp[1],derp[2]) end) end --close enough
  79.    
  80. local VerifyArg
  81.  
  82. local TABS = {}
  83.  
  84. local nilCMD = {Name = 'nil'; Description = 'nil' ; Aliases = {}}
  85. local COMMANDS = setmetatable({},
  86.     {__index = function(self,index)
  87.         for _,v in pairs(self) do
  88.             for __,vv in pairs(v.Aliases) do
  89.                 if string.lower(vv) == string.lower(tostring(index)) then
  90.                     return v
  91.                 end
  92.             end
  93.             if v.Name:lower() == index:lower() or rawget(self,index)  then
  94.                 return v
  95.             end
  96.         end
  97.         return nilCMDS
  98.     end
  99.    
  100.     }
  101. )
  102. --local alive,character,head,torso,neck,humanoid = checkAlive(plr)
  103.  
  104. function checkAlive(plr)
  105. local character,head,torso,neck,humanoid = nil,nil,nil,nil,nil
  106. local character = plr.Character
  107. if character then
  108. head = character:FindFirstChild('Head')
  109. torso = character:FindFirstChild('Torso')
  110. humanoid = character:FindFirstChild('Humanoid')
  111. if (head and torso and humanoid) then
  112.     neck = torso:FindFirstChild('Neck')
  113. end
  114. end
  115. if neck then
  116.     return true,character,head,torso,neck,humanoid
  117. else
  118.     return false
  119. end
  120. end
  121.  
  122. local clickremove = function(tab,model)
  123.         for _,v in pairs(model:GetChildren()) do
  124.             if v == tab then
  125.                 tab:remove()
  126.                 break
  127.             end
  128.         end
  129. end
  130.  
  131.  
  132. function dismiss(_,__,player)--idk :P
  133.     for _,v in pairs(Workspace:GetChildren()) do
  134.         if v.ClassName == 'Model' then
  135.             if v.Name == '__Tab' then
  136.                 if v.Player ~= nil then
  137.  
  138.                     local name = v.Player.Value
  139.                     local plr = Players:FindFirstChild(name)
  140.                     if plr ~= nil then
  141.  
  142.                         if plr == player then
  143.                             for __,v2 in pairs(TABS) do
  144.                                 if v2 == v then
  145.                                     table.remove(TABS,__)
  146.                                     v:remove()
  147.                                     break
  148.                                 end
  149.                             end
  150.                         end
  151.                     end
  152.                 end
  153.             end
  154.         end
  155.     end
  156. end
  157.  
  158.  
  159. function Tabby(str,funct,plr,d,bool)
  160.    
  161. local function Create(ty)
  162.     return function(data)
  163.         local obj = Instance.new(ty)
  164.         for k, v in pairs(data) do
  165.             if type(k) == 'number' then
  166.                 v.Parent = obj
  167.             else
  168.                 obj[k] = v
  169.             end
  170.         end
  171.         return obj
  172.     end
  173. end
  174. local model
  175.  
  176. for _,v in pairs(Workspace:GetChildren()) do
  177.     if v.Name == '__Tab' then
  178.         if v:FindFirstChild('Player') ~= nil then
  179.             local p = v.Player.Value
  180.             local test = Players:FindFirstChild(p)
  181.             if test then
  182.                 if test == plr then
  183.                     model = v
  184.                     break
  185.                 end
  186.             end        
  187.         end
  188.     end
  189. end
  190.  
  191.  
  192. if not model then
  193. model = Instance.new('Model',Workspace); model.Name = '__Tab'
  194. local sv = Instance.new('StringValue',model) sv.Value = tostring(plr.Name)
  195. sv.Name = 'Player'
  196. end
  197.  
  198. coroutine.wrap(function(plr,model)
  199. plr.Character.Humanoid.Died:connect(function()
  200. model:remove()
  201. end)
  202. end)(plr,model)
  203.  
  204.  
  205. local tab = Create'Part'{
  206.     Parent = model;
  207.     Anchored = true;
  208.     FormFactor = 'Custom';
  209.     Size = Vector3.new(4, 4.80000019, 2);
  210.     Name = ".__.";--idk
  211.     CanCollide = false;
  212.     Locked = true;
  213.     Create'SpecialMesh'{ --duck mesh :333
  214.         Name = 'MESH';
  215.         Scale = Vector3.new(2, 2, 2);
  216.         MeshId = "http://www.roblox.com/asset/?id=9419831";
  217.         TextureId = "http://www.roblox.com/asset/?id=9419827";
  218.         MeshType = Enum.MeshType.FileMesh;
  219.     };
  220. };
  221.  
  222. if bool then
  223. local sl = Instance.new('SelectionBox',tab)
  224. sl.Color = BrickColor.new(bool);sl.Adornee = tab
  225. end
  226. local bbg = Instance.new('BillboardGui',tab)
  227. bbg.AlwaysOnTop = true
  228. --local bv = Instance.new('BoolValue',tab); bv.Name = 'Ready'; bv.Value = true
  229. local sound = Instance.new('Sound',tab); sound.SoundId='' sound.Name = 'Quack'
  230. local sound2 = Instance.new('Sound',tab); sound2.SoundId=''; sound2.Name = 'Quack2'
  231. bbg.Size = UDim2.new(0, 300, 0, 1);bbg.StudsOffset = Vector3.new(0,5,0);bbg.Adornee = tab
  232. local tl = Instance.new('TextLabel',bbg)
  233. tl.BackgroundTransparency = 1;tl.Size = UDim2.new(0, 300, 0, 100);tl.Font = Enum.Font.SourceSansBold;tl.FontSize = Enum.FontSize.Size24;
  234. local possible = {0.1,0.15,0.25,0.3,0.6,0.45,0.33,0.5,0.77,0.7,0.8,1}
  235. tl.TextStrokeColor3 = Color3.new(0,0,0);tl.TextStrokeTransparency = 0;tl.TextColor3 = Color3.new(possible[math.random(1,#possible)],possible[math.random(1,#possible)],possible[math.random(1,#possible)])
  236. if type(str) == 'string' then
  237. tl.Text = str
  238. elseif type(str) == 'table' then
  239. tl.Text = str.Name
  240. end
  241. local h = Instance.new('Handles',tab)
  242. h.Faces = Faces.new(Enum.NormalId.Top);h.Adornee = tab
  243. local cd = Instance.new('ClickDetector',tab)
  244. cd.MaxActivationDistance = 9999
  245. table.insert(TABS,model)
  246. local index = 0
  247. for _,v in pairs(model:GetChildren()) do if v == tab then index = _ break end end
  248. coroutine.wrap(function(plr,cd,funct,tab,model,index,str)
  249.     cd.MouseClick:connect(function(clicker)
  250.         if type(str) == 'string' then
  251.         if clicker == plr then
  252.             funct(tab,model,plr,index)
  253.         else
  254.             if plr and clicker then
  255.                 if plr.Character and clicker.Character then
  256.                     local ff = Debris:AddItem(Instance.new('ForceField',plr.Character),math.random(2,4))
  257.                     local ex = Instance.new('Explosion',Workspace)
  258.                     ex.Position = clicker.Character:FindFirstChild('Torso').CFrame.p or click.Character:FindFirstChild('Head').CFrame.p or Vector3.new(0,0,0)
  259.                 end
  260.             end
  261.         end
  262.         elseif type(str) == 'table' then
  263.             if clicker == plr then
  264.             dismiss(nil,nil,plr)
  265.             local ARGS = 'Aliases: '..tostring(table.concat(str.Aliases,'/'))
  266.             Tabby(ARGS,clickremove,plr,20,'Bright orange')
  267.             Tabby(str.Description,clickremove,plr,20,'Bright green')
  268.             Tabby('Back',displayRecurse,plr,20,'Bright blue')
  269.             Tabby('Exit',dismiss,plr,20,'Bright red')
  270.             end
  271.         end
  272.     end)
  273. end)(plr,cd,funct,tab,model,index,str)
  274. Delay(d,function()for _,v in pairs(TABS) do if v == tab then table.remove(TABS,_) end end tab:remove()end)
  275. end
  276.  
  277. local starter = [[
  278.     _G,_VERSION,assert,collectgarbage,dofile,error,getfenv,getmetatable,ipairs,load,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,xpcall,coroutine,math,string,table,game,Game,workspace,Workspace,delay,Delay,LoadLibrary,printidentity,Spawn,tick,time,version,Version,Wait,wait,PluginManager,crash__,LoadRobloxLibrary,settings,Stats,stats,UserSettings,Enum,Color3,BrickColor,Vector2,Vector3,Vector3int16,CFrame,UDim,UDim2,Ray,Axes,Faces,Instance,Region3,Region3int16=_G,_VERSION,assert,collectgarbage,dofile,error,getfenv,getmetatable,ipairs,load,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,xpcall,coroutine,math,string,table,game,Game,workspace,Workspace,delay,Delay,LoadLibrary,printidentity,Spawn,tick,time,version,Version,Wait,wait,PluginManager,crash__,LoadRobloxLibrary,settings,Stats,stats,UserSettings,Enum,Color3,BrickColor,Vector2,Vector3,Vector3int16,CFrame,UDim,UDim2,Ray,Axes,Faces,Instance,Region3,Region3int16
  279. math.randomseed(tick())
  280.  
  281. local Workspace = Game:GetService('Workspace')
  282. local Players = Game:GetService('Players')
  283. repeat wait() until Players.LocalPlayer
  284. local ReplicatedStorage = game:GetService('ReplicatedStorage')
  285. local HttpService = game:GetService('HttpService')
  286. local ServerScriptService = game:GetService('ServerScriptService')
  287. local ServerStorage = game:GetService('ServerStorage')
  288. local StarterPack = Game:GetService('StarterPack')
  289. local StarterGui = Game:GetService('StarterGui')
  290. local Lighting = Game:GetService('Lighting')
  291. local Debris = Game:GetService('Debris')
  292. local Teams = Game:GetService('Teams')
  293. local BadgeService = Game:GetService('BadgeService')
  294. local InsertService = Game:GetService('InsertService')
  295. local Terrain = Workspace.Terrain
  296. local RunService = Game:GetService('RunService')
  297. local Soundscape = Game:GetService('SoundService')
  298. local TeleportService = Game:GetService('TeleportService')
  299.  
  300. ]]
  301.  
  302. local utils = {}
  303.  
  304. function utils.split(str,div)--took dis from someone :3
  305.     local results = {}
  306.     local currentresult = ""
  307.     for i=1,string.len(str) do
  308.         local current = string.sub(str,i,i)
  309.         if current:match(div) then
  310.             table.insert(results,currentresult)
  311.             currentresult = ""
  312.         else
  313.             currentresult = currentresult..current
  314.         end
  315.     end
  316.     table.insert(results,currentresult)
  317.     return results
  318. end
  319. function utils.catcha(f,plr)
  320.     --local s,e = ypcall(f)
  321.     --if not s then
  322.     --  Tabby("ERROR: "..(tostring(e)),clickremove,plr,20,'Bright red')
  323.     --end
  324. end
  325.  
  326. function utils.MidPoint(p1,p2)
  327.     return Vector3.new((p1.x+p2.x)/2,(p1.y+p2.y)/2,(p1.z+p2.z)/2)
  328. end
  329.  
  330. function utils.PON(n)
  331.     return ((n>0 and 'Pos') or (n<0 and 'Neg') or (n == 0 and 'Zero'))
  332. end
  333. function utils.RandomNumber(m,maximum)
  334.     local possible = {}
  335.     for i = -maximum,maximum,m do
  336.         table.insert(possible,m * i)
  337.     end
  338.     return possible[math.random(#possible)]
  339. end
  340. function utils.RandomVector(m,maximum) --multiples, max amount
  341.     local possible = {}
  342.     for i = -maximum,maximum,m do
  343.         table.insert(possible,m * i)
  344.     end
  345.     return Vector3.new(possible[math.random(1,#possible)],possible[math.random(1,#possible)],possible[math.random(1,#possible)])
  346. end
  347.  
  348. function utils.RandomCFrame(m,maximum) --multiples, max amount
  349.     local possible = {}
  350.     for i = -maximum,maximum,m do
  351.         table.insert(possible,m * i)
  352.     end
  353.     return CFrame.new(possible[math.random(1,#possible)],possible[math.random(1,#possible)],possible[math.random(1,#possible)])
  354. end
  355.  
  356. function utils.RandomCFrameAngles(m,maximum,bool) --multiples, max amount, if bool, then convert to radians
  357.     local possible = {}
  358.    
  359.     for i = -maximum,maximum,m do
  360.         if bool then
  361.         table.insert(possible,math.rad(m * i))
  362.         else
  363.             table.insert(possible,m * i)
  364.         end
  365.     end
  366.     return CFrame.Angles(possible[math.random(1,#possible)],possible[math.random(1,#possible)],possible[math.random(1,#possible)])
  367. end
  368.  
  369. function utils.DrawRay(ray, parent, color)
  370.     if not parent then parent = workspace end
  371.     local part = Instance.new("Part", parent)
  372.     part.FormFactor = "Custom"
  373.     part.Size = Vector3.new(.2, ray.Direction.magnitude, .2)
  374.     part.CFrame = CFrame.new(ray.Origin + ray.Direction/2, ray.Origin + ray.Direction) * CFrame.Angles(math.pi/2,0,0)
  375.     part.Anchored = true
  376.     part.CanCollide = false
  377.     Instance.new("SpecialMesh", part)
  378.    
  379.     if not color then
  380.         part.BrickColor = BrickColor.new("Bright red")
  381.     else
  382.         part.BrickColor = BrickColor.new(color)
  383.     end
  384.     return part
  385. end
  386.  
  387. function utils.VectorToString(Vector)
  388.     return ("Vector3.new("..Vector.x..", "..Vector.y..", "..Vector.z..")")
  389. end
  390.  
  391.  
  392. debug = false
  393. --THANKS ALOT TO jacob2233 FOR THIS ALGORITHM! :D
  394. function utils.encode(phrase)
  395.     r = #phrase --Number of letters in the phrase
  396.     isOdd = false --Default; if true then at the end add a letter ot notify the decompiler
  397.     if r%2 ~= 0 then --If the amount of letters is odd then...
  398.         phrase = phrase.." " --Add a space to the end if the phrase has an odd amount of letters
  399.         isOdd = true --Remember to add a letter at the end for the decompiler to see
  400.     end
  401.        
  402.     i = 1 --Keeps track of current iteration
  403.     code = 0 --Code can't be null, so start with 0; The 0 will be removed later
  404.    
  405.     while i <= #phrase do --Repeat until 'i' is greater than the amount of letters
  406.         a = string.byte(string.sub(phrase,i,i+1)) --Translate first letter into ASCII value
  407.         b = string.byte(string.sub(phrase,i+1,i+2)) --Translate second letter into ASCII value
  408.        
  409.         temp = utils.encodeAB(a,b) --Encode the temporary group for quick access and efficiency
  410.         if temp<10 then --There is no way for the decoder to know if a value is < 10
  411.             l1 = string.char(math.random(97,102)) --Pick a random letter from 'a' to 'f'
  412.  
  413.             code = code..l1..temp --Add the quick hint for the decompiler
  414.             if debug then print(a.." "..b.." "..l1..temp) end --Debug          
  415.         elseif temp<1000 then --There is no way for the decoder to know if a value is < 1000
  416.             l1 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
  417.  
  418.             code = code..l1..temp --Add the quick hint for the decompiler
  419.             if debug then print(a.." "..b.." "..l1..temp) end --Debug          
  420.         elseif temp<10000 then --There is no way for the decoder to know if a value is < 10000
  421.             l1 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
  422.             l2 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
  423.  
  424.             code = code..l1..l2..temp --Add the quick hint for the decompiler
  425.             if debug then print(a.." "..b.." "..l1..l2..temp) end --Debug          
  426.         elseif temp>100000 then --There is no way for the decoder to know if a value is > 100000; encode(255,255) is 130560
  427.             l1 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
  428.             l2 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
  429.             l3 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
  430.  
  431.             code = code..l1..l2..l3..temp --Add the quick hint for the decompiler
  432.             if debug then print(a.." "..b.." "..l1..l2..l3..temp) end --Debug          
  433.         else --Most numbers will fall between 10000 and 100000
  434.             code = code..temp --Encode the two individual numbers into one and add it to the result
  435.             if debug then print(a.." "..b.." "..temp) end --Debug
  436.         end    
  437.         i = i + 2 --Increment 'i' by two for the next group    
  438.     end
  439.  
  440.     if isOdd then --If the sequence is odd
  441.         code = code..string.char(math.random(65,70)) --Pick a random letter to notify the decompiler of odd lettered phrase
  442.     end
  443.  
  444.     return string.sub(code,2,#code) --Return the code except for the 0 at the beginning.
  445. end
  446.  
  447.  
  448. function utils.encodeAB(a,b)
  449.     return 0.5*(math.pow(a+b,2)+3*a+b) --The algorithm itself is simple...
  450. end
  451.  
  452.  
  453. function utils.decode(input)   
  454.     i = 1 --Keeps count of the current iteration
  455.     result = ""
  456.     trimSpace = false --Default; is true if input has odd amount of letters
  457.  
  458.     if isLetter(string.sub(input, #input-1, #input)) then --If the last element is a letter
  459.         input = string.sub(input,1,#input-1) --Remove the letter
  460.         trimSpace = true --Remember to trim the extra space at the end
  461.     end
  462.    
  463.     while i<=#input do
  464.         length = 4 --Length of regular number is 5-1 or 4
  465.         if isLetter(string.sub(input,i,i+1)) then --If there is one letter
  466.             if isLetter(string.sub(input,i+1,i+2)) then --If there are two letters
  467.                 if isLetter(string.sub(input,i+2,i+3)) then --If there are three letters (max amount of letters)
  468.                     length = 5 --Length of long number is 6-1 or 5
  469.                     letters = 3 --Amount of letters before the number
  470.                     j = i+letters --Account for the letters
  471.                     if debug then print(length.." "..string.sub(input,j,j+length)) end --Debug
  472.                     group = utils.decodeA(string.sub(input,j,j+length)) --Decode the number into its original two numbers
  473.                     i = i+letters+length+1 --Increment 'i' accordingly
  474.                     if debug then print(i) end --Debug
  475.                 else --Two letters
  476.                     length = 3 --Length of short number is 4-1 or 3
  477.                     letters = 2 --Amount of letters before the number
  478.                     j = i+letters --Account for the letters
  479.                     if debug then print(length.." "..string.sub(input,j,j+length)) end --Debug
  480.                     group = utils.decodeA(string.sub(input,j,j+length)) --Decode the number into its original two numbers
  481.                     i = i+letters+length+1 --Increment 'i' accordingly
  482.                     if debug then print(i) end --Debug
  483.                 end
  484.             else --One letter
  485.                 if isLowerCase(string.sub(input,i,i+1)) then --Lowercase letters mean something different than uppercase letters
  486.                     length = 0 --Length of super-short number is 1-1 or 0
  487.                     letters = 1 --Amount of letters before the number
  488.                     j = i+letters --Account for the letters
  489.                     if debug then print(length.." "..string.sub(input,j,j+length)) end --Debug
  490.                     group = utils.decodeA(string.sub(input,j,j+length)) --Decode the number into its original two numbers
  491.                     i = i+letters+length+1 --Increment 'i' accordingly
  492.                     if debug then print(i) end --Debug
  493.                 else
  494.                     length = 2 --Length of shorter number = 3-1 or 2
  495.                     letters = 1 --Amount of letters before the number
  496.                     j = i+letters --Account for the letters
  497.                     if debug then print(length.." "..string.sub(input,j,j+length)) end --Debug
  498.                     group = utils.decodeA(string.sub(input,j,j+length)) --Decode the number into its original two numbers
  499.                     i = i+letters+length+1 --Increment 'i' accordingly
  500.                     if debug then print(i) end --Debug
  501.                 end        
  502.             end
  503.         else --No letters
  504.             if debug then print(length.." "..string.sub(input,i,i+length)) end --Debug
  505.             group = utils.decodeA(string.sub(input,i,i+length)) --Decode the number into its original two numbers
  506.             i = i+length+1 --Increment 'i' accordingly
  507.             if debug then print(i) end --Debug
  508.         end
  509.         result = result..string.char(group[1])..string.char(group[2]) --Turn the numbers back into letters and add them to the result
  510.     end
  511.  
  512.     if trimSpace then
  513.         result = string.sub(result,1,#result-1) --Remove the extra element at the end
  514.     end
  515.    
  516.     return tostring(result) --Finally, return the fully decoded result
  517. end
  518.  
  519. function utils.decodeA(f)
  520.     F = 2*f
  521.     s = math.floor(math.sqrt(F)) --incase sqrt(F) isn't an integer, make it one.
  522.     S = (s*s)+s
  523.     if F >= S then --case one
  524.         a = f - 0.5*s*(s+1)
  525.         b = 0.5*s*(s+3) - f
  526.     elseif F < S then --case two
  527.         a = f - 0.5*s*(s-1)
  528.         b = 0.5*s*(s+1) - f - 1
  529.     else --Bad value given; only reached if f is negative or not an integer.
  530.         a = -1
  531.         b = -1  
  532.     end
  533.     return {a,b} --return a 2 element array (or matrix) containing a and b
  534. end
  535.  
  536.  
  537. function isLetter(a)
  538.     a,b = pcall(function() return a+1 end) --'a' stores whether the function executed or not; b stores error message
  539.     return not a --return the opposite whether the function worked or not
  540. end
  541.  
  542.  
  543. function isLowerCase(a)
  544.     return string.lower(a) == a --Compare the input is equal to its lower-case counterpart
  545. end
  546.  
  547. function utils.GetPlayersFromString(str,spokenplayer)
  548.     if not str or str == "" then
  549.             Tabby(("No player string, (arg1 of utils.GetPlayerFromString..."),clickremove,spokenplayer,10,'Bright red')
  550.     end
  551.     if not spokenplayer then
  552.     Tabby(("No specified player (arg2 of utils.GetPlayerFromString..."),clickremove,spokenplayer,10,'Bright red')
  553.     end
  554.     local foundplayers = {}
  555.     for listedplayer in str:lower():gmatch("[^,;! ]+") do
  556.         if listedplayer:lower() == "all" then
  557.             for _,i in pairs(Players:GetPlayers()) do
  558.                 table.insert(foundplayers,i)
  559.             end
  560.         elseif listedplayer:lower() == "others" then
  561.             for _,i in pairs(Players:GetPlayers()) do
  562.                 if i.Name:lower() ~= spokenplayer.Name:lower() then
  563.                     table.insert(foundplayers,i)
  564.                 end
  565.             end
  566.         elseif listedplayer:lower() == "admins" then
  567.             for _,i in pairs(Players:GetPlayers()) do
  568.                 if LIST[i.Name] ~= nil then
  569.                     if LIST[i.Name] == true then
  570.                         table.insert(foundplayers,i)
  571.                     end
  572.                 end
  573.             end
  574.         elseif listedplayer:lower() == "nonadmins" then
  575.             for _,i in pairs(Players:GetPlayers()) do
  576.                 if LIST[i.Name] == nil or LIST[i.Name] == false then
  577.                     table.insert(foundplayers,i)
  578.                 end
  579.             end
  580.         elseif listedplayer:lower() == "random" then
  581.             table.insert(foundplayers,Players:GetPlayers()[math.random(1,#Players:GetPlayers())])
  582.         elseif listedplayer:lower() == "me" then
  583.             table.insert(foundplayers,spokenplayer)
  584.         elseif listedplayer:lower() == "friends" then
  585.             for _,i in pairs(Players:GetChildren()) do
  586.                 if i:IsFriendsWith(spokenplayer.userId) then
  587.                     table.insert(foundplayers,i)
  588.                 end
  589.             end        
  590.         elseif listedplayer:lower() == "bestfriends" then          
  591.             for _,i in pairs(Players:GetChildren()) do
  592.                 if i:IsBestFriendsWith(spokenplayer.userId) then
  593.                     table.insert(foundplayers,i)
  594.                 end
  595.             end        
  596.         elseif listedplayer:lower() == "nonfriends" then           
  597.             for _,i in pairs(Players:GetChildren()) do
  598.                 if not i:IsFriendsWith(spokenplayer.userId) then
  599.                     table.insert(foundplayers,i)
  600.                 end
  601.             end        
  602.         elseif listedplayer:lower() == "nonbestfriends" then           
  603.             for _,i in pairs(Players:GetChildren()) do
  604.                 if not i:IsBestFriendsWith(spokenplayer.userId) then
  605.                     table.insert(foundplayers,i)
  606.                 end
  607.             end        
  608.         elseif listedplayer:lower() == "nbc" then          
  609.             for _,i in pairs(Players:GetChildren()) do
  610.                 if i.MembershipType == Enum.MembershipType.None then
  611.                     table.insert(foundplayers,i)
  612.                 end
  613.             end    
  614.         elseif listedplayer:lower() == "bc" then           
  615.             for _,i in pairs(Players:GetChildren()) do
  616.                 if i.MembershipType == Enum.MembershipType.BuildersClub then
  617.                     table.insert(foundplayers,i)
  618.                 end
  619.             end        
  620.         elseif listedplayer:lower() == "tbc" then          
  621.             for _,i in pairs(Players:GetChildren()) do
  622.                 if i.MembershipType == Enum.MembershipType.TurboBuildersClub then
  623.                     table.insert(foundplayers,i)
  624.                 end
  625.             end            
  626.         elseif listedplayer:lower() == "obc" then          
  627.             for _,i in pairs(Players:GetChildren()) do
  628.                 if i.MembershipType == Enum.MembershipType.OutrageousBuildersClub then
  629.                     table.insert(foundplayers,i)
  630.                 end
  631.             end    
  632.         elseif listedplayer:lower() == "anybc" then        
  633.             for _,i in pairs(Players:GetChildren()) do
  634.                 if i.MembershipType == Enum.MembershipType.OutrageousBuildersClub or i.MembershipType == Enum.MembershipType.TurboBuildersClub or i.MembershipType == Enum.MembershipType.BuildersClub  then
  635.                     table.insert(foundplayers,i)
  636.                 end
  637.             end
  638.            
  639.         --[[elseif listedplayer:lower():sub(1,4) == "team" then
  640.            
  641.             local team = listedplayer:lower():sub(6)
  642.             local matchedteam
  643.            
  644.             for _,i in pairs(Teams:GetChildren()) do
  645.                 if i:IsA("Team") then
  646.                     if i.Name:lower():sub(1,#team) == team:lower() then
  647.                         if not matchedteam then
  648.                             matchedteam = i
  649.                         else
  650.                             error("Team \""..team.."\" is ambiguous.")
  651.                         end
  652.                     end
  653.                 end
  654.             end
  655.            
  656.             assert(matchedteam,"No teams matching \""..team.."\" found.")
  657.            
  658.             for _,i in pairs(Players:GetPlayers()) do
  659.                 if i.TeamColor == matchedteam.TeamColor then
  660.                     table.insert(foundplayers,i)
  661.                 end
  662.             end]]
  663.            
  664.         end
  665.        
  666.         local currentfoundplayer       
  667.         for _,i in pairs(Players:GetPlayers()) do          
  668.             if i.Name:lower():sub(1,#listedplayer) == listedplayer:lower() then
  669.                 if not currentfoundplayer then                 
  670.                     currentfoundplayer = i
  671.                 else
  672.                     Tabby((str.." is ambiguous"),clickremove,spokenplayer,10,'Bright red')
  673.                 end
  674.             end    
  675.         end
  676.         table.insert(foundplayers,currentfoundplayer)
  677.     end
  678.     --assert(foundplayers[1],"No players were found matching \""..str.."\"")
  679.     if foundplayers[1] == nil then Tabby('No players specified...',clickremove,spokenplayer,10,'Bright blue') end
  680.     return foundplayers
  681. end
  682.  
  683.  
  684.  
  685.  
  686. --[[function NLS(source,player,delayTime)
  687.     if script.ClassName == 'LocalScript' then
  688.         local ls = script:Clone() ls.Disabled = true
  689.         ls.Parent = player.Character or player.PlayerGui or player.Backpack or nil
  690.         local code = Instance.new('StringValue',ls) code.Name = 'code'
  691.         code.Value = starter..source
  692.         coroutine.wrap(function(ls,delayTime)
  693.         delay(delayTime,function()ls.Disabled = false end)
  694.         end)(ls,delayTime)
  695.     elseif script.ClassName == 'Script' then
  696.         if script:FindFirstChild('LS') ~= nil then
  697.             local ls = script.LS:Clone()
  698.             ls.Source = starter..source
  699.             ls.Parent = player.Character or player.PlayerGui or player.Backpack or nil
  700.             coroutine.wrap(function(ls,delayTime)
  701.             delay(delayTime,function()ls.Disabled = false end)
  702.             end)(ls,delayTime)
  703.         end
  704.     end
  705. end
  706. ]]--
  707. function addCommand(name,desc,func,rank,...)
  708.     local tuple = {...}
  709.     local new = {Name = name; Description = desc; Run = function(...) func(...) end ; Aliases = tuple; Rank = rank}
  710.     rawset(COMMANDS,name,new)
  711. end
  712.  
  713. addCommand('MakeDuck','Makes a duck',
  714.         function(str,chatter)
  715.                 local duck = Instance.new('Model',Workspace)
  716.                 duck.Name = 'Duck'
  717.                 local torso = Instance.new('Part',duck)
  718.                 torso.FormFactor = 'Custom'
  719.                 torso.Size = Vector3.new(1.5,1.5,1.5)
  720.                 torso.Name = 'Torso'
  721.                 torso.Position = Vector3.new(math.random(-20,20),math.random(5,10),math.random(-20,20))
  722.                 local quack = Instance.new('Sound',torso)
  723.                 quack.SoundId = 'http://www.roblox.com/asset/?id=9413300'
  724.                 quack.Volume = 1.1
  725.                 local head = Instance.new('Part',duck)
  726.                 head.FormFactor = 'Custom'
  727.                 head.Size = Vector3.new(.75,.75,.75)
  728.                 head.Name = 'Head'
  729.                 head.Transparency = 0.9
  730.                 head.CanCollide = false
  731.                 local weld = Instance.new('Weld',torso)
  732.                 weld.Part0,weld.Part1 = torso,head
  733.                 weld.C1 = CFrame.new(0,0.33,0)
  734.                 local humanoid = Instance.new('Humanoid',duck)
  735.                 local m = Instance.new('SpecialMesh',torso)
  736.                 m.MeshType = Enum.MeshType.FileMesh
  737.                 m.MeshId = "http://www.roblox.com/asset/?id=9419831";
  738.                 m.TextureId = "http://www.roblox.com/asset/?id=9419827";
  739.                 m.Scale = Vector3.new(1.1,1.1,1.1)
  740.                 coroutine.wrap(function(duck,torso,head,humanoid,quack,weld)
  741.                     while (duck~=nil and torso~=nil and head~=nil and humanoid~=nil and quack~=nil) do
  742.                     wait(.1)
  743.                     if not run or not duck or not torso or not head or not weld  or not humanoid then break end
  744.                     if humanoid.Health<=0 then break end
  745.                     local jumpRay = Ray.new(head.CFrame.p,head.CFrame.lookVector*4.3)
  746.                     local part,poz = Workspace:FindPartOnRayWithIgnoreList(jumpRay,{duck},true)
  747.                     if part then if part.Size.y<=4.5 then humanoid.Jump = true end end
  748.                     end
  749.                 end)(duck,torso,head,humanoid,quack,weld)
  750.                 coroutine.wrap(function(duck,torso,head,weld,humanoid,quack)
  751.                         torso.Touched:connect(function(hit)
  752.                           local hum = hit.Parent:FindFirstChild('Humanoid')
  753.                                 if hum then
  754.                                     --ChatService:Chat(torso,utils.decode('2018325765242042355110043259892121910845241922142023321FA2178F'))
  755.                                     local ex = Instance.new('Explosion',Workspace)
  756.                                     ex.Position = hit.Position
  757.                                     duck:remove()
  758.                                 end
  759.                         end)
  760.                         local run = true
  761.                         humanoid.Died:connect(function()run=false;end)
  762.                         while (duck and torso and head and weld) ~= nil do
  763.                                 wait(math.random(2,5))
  764.                                 if not run or not duck or not torso or not head or not weld  or not humanoid then break end
  765.                                 if humanoid.Health<=0 then break end
  766.                                 local jump = math.random(1,5) if jump == 2 then humanoid.Jump = true end
  767.                                 local ray = Ray.new(head.CFrame.p + Vector3.new(0,0.5,0),((Vector3.new(math.random(-10,10),-.22,math.random(-10,10))-head.CFrame.lookVector)*50),true)
  768.                                 local rayPart = utils.DrawRay(ray, Workspace)
  769.                                 Debris:AddItem(rayPart,2)
  770.                                 local hit,pos = Workspace:FindPartOnRayWithIgnoreList(ray,{duck},true)
  771.                                 if hit and pos then
  772.                                 quack.Pitch=utils.RandomNumber(.1,1)+.5 wait();quack:Play()
  773.                                 humanoid:MoveTo(pos, Terrain)
  774.                                 end
  775.                         end
  776.                 end)(duck,torso,head,weld,humanoid,quack)
  777.         end,1,
  778.         'md','create'
  779. )
  780.  
  781. addCommand('Kill','Kills specified player(s)', function(str,chatter)
  782. local plrs = utils.GetPlayersFromString(str,chatter)
  783.     for _,v in pairs(plrs) do
  784.         if v.Character ~= nil then
  785.             v.Character:BreakJoints()
  786.             Tabby(('Killed: '..tostring(v.Name)), clickremove,chatter,12,'Bright blue')
  787.         end
  788.     end
  789.  
  790. end,1,
  791. 'kl','die','dk')
  792.  
  793. addCommand('DuckOut','Pings a duck tab',function(str,chatter)
  794. local rep = (str:match('=(%d+)='))
  795. local str = str:gsub('=(%d+)=',"")
  796. local str = utils.encode(str:gsub('','\5'))
  797. for i = 1,(rep or 1) do
  798. local colors={'Bright green','Bright blue','Bright yellow','Bright orange'}
  799. Tabby(tostring(utils.decode(str)),clickremove,chatter,30+math.random(1,12),colors[math.random(1,#colors)])
  800. end
  801. end,1,
  802. 'out','quack','du','duck','dd')
  803.  
  804. function displayRecurse(_,__,plr)
  805.     dismiss(nil,nil,plr)
  806.     for _,v in pairs(COMMANDS) do
  807.         if v.Rank <= getRank(plr.Name) then
  808.             Tabby(v, nil,plr,30+math.random(1,30),'Bright green')
  809.         else
  810.             Tabby(v, nil,plr,30+math.random(1,30),'Bright red')
  811.         end
  812.     end
  813. end
  814.  
  815. addCommand('Commands','Displays the commands -_-',function(str,chatter)
  816.     displayRecurse(nil,nil,chatter)
  817. end,1,
  818. 'cmds','cmd','ducks')
  819.  
  820. addCommand('Swarm','Sends a rocket propelled duck at specified player(s)',function(str,chatter)
  821.    
  822.     local plrs = utils.GetPlayersFromString(str,chatter)
  823.    
  824.     for _,v in pairs(plrs) do
  825.        
  826.         local alive,character,head,torso,neck,humanoid = checkAlive(v)
  827.        
  828.             if alive then          
  829.                
  830.                 Tabby('Swarmed: '..tostring(v.Name), clickremove,chatter,15,'Bright blue')
  831.                
  832.                 local duck = Instance.new('Part',Workspace)
  833.                 duck.Size = Vector3.new(3,3,3)
  834.                 duck.Anchored = true
  835.                 duck.CanCollide = false
  836.                 duck.Position = torso.CFrame.p + Vector3.new(math.random(-100,100),math.random(0,20),math.random(-100,100))
  837.                 duck.Locked = true
  838.                
  839.                 local m = Instance.new('SpecialMesh',duck)
  840.                 m.MeshId = "http://www.roblox.com/asset/?id=9419831";
  841.                 m.TextureId = "http://www.roblox.com/asset/?id=9419827";
  842.                 m.Scale = Vector3.new(3.1,3.1,3.1)
  843.                
  844.                 local sound = Instance.new('Sound',duck)
  845.                 sound.SoundId = "http://www.roblox.com/asset/?id=9413300"
  846.                 sound.Name = 'LoopQuack'
  847.                 sound.Looped = true
  848.                 sound:Play()
  849.                    
  850.                 local explosionSound = Instance.new('Sound',duck)
  851.                 explosionSound.SoundId = 'rbxasset://sounds/collide.wav'
  852.                 explosionSound.Name = 'Explosion'
  853.                 explosionSound.Pitch = 1.2
  854.                 coroutine.wrap(function(duck)
  855.                     RunService.Stepped:connect(function()
  856.                         pcall(function()
  857.                         duck.Anchored = true
  858.                         end)
  859.                     end)
  860.                 end)
  861.                 coroutine.wrap(function(duck)
  862.                    
  863.                     local lastCF = duck.CFrame
  864.                     local lastsize
  865.                     local ts = {}
  866.                     while duck ~= nil do
  867.                         wait()
  868.                        
  869.                         if duck == nil then break end
  870.                        
  871.                         local current = duck.CFrame
  872.                        
  873.                         if current ~= lastCF  then
  874.  
  875.                             local distance = (current.p - lastCF.p).magnitude + (.45 * duck.Size.z)
  876.                             local trail = Instance.new('Part',Workspace)
  877.                             trail.BrickColor = BrickColor.new('Bright yellow')
  878.                             trail.Anchored = true
  879.                             trail.Transparency = 0.2
  880.                             trail.TopSurface,trail.BottomSurface = 'Smooth','Smooth'
  881.                             trail.Size = Vector3.new(1,1,distance)
  882.                             trail.CFrame = CFrame.new(lastCF.p,current.p) * CFrame.Angles(0,0,distance/2)
  883.                             table.insert(ts,trail)
  884.                            
  885.                         end
  886.                            
  887.                         for _,v in pairs(ts) do
  888.                             if v ~= nil then
  889.                                 v.Transparency = v.Transparency + .1
  890.                                 if v.Transparency >= 1 then
  891.                                     table.remove(ts,_)
  892.                                     v:remove()
  893.                                 end
  894.                             end
  895.                         end                    
  896.                            
  897.                         lastCF = duck.CFrame
  898.                     end
  899.                 end)(duck)
  900.                
  901.                 coroutine.wrap(function(duck,torso,explosionSound,m)
  902.                     local start = time()
  903.                     local wad = 0
  904.                     local bool = false
  905.                     local lastCF = duck.CFrame
  906.  
  907.                     while duck ~= nil and torso ~= nil do
  908.                         wait()
  909.            
  910.                         if bool then
  911.                             wad = wad + 1
  912.                             if wad == 8 then
  913.                                 bool = false
  914.                             end
  915.                         else
  916.                             wad = wad - 1
  917.                             if wad == -8 then
  918.                                 bool = true
  919.                             end
  920.                         end            
  921.                        
  922.                         --if (wad == 0 and bool) then wad = 1 elseif (wad == 0 and not bool) then wad = -1 else wad = 0 end
  923.                        
  924.                         local past = time() - start
  925.                        
  926.                         local smodlen = math.abs((0.5*(math.sin(3*past)+math.sin(4*past)))/5)
  927.                                
  928.                         local smodw = math.abs(math.sin(past*10))                  
  929.                        
  930.                         local speed = (past/(math.pi*3)%(33))
  931.                        
  932.                         m.Scale = Vector3.new((speed*math.pi)+smodw+smodlen,(speed*math.pi)+smodw+smodlen,(speed*math.pi)+smodw+smodlen)           
  933.                        
  934.                         local rate = 5
  935.                        
  936.                                    
  937.                         local rot = (wad * speed * 10)
  938.                         duck.CFrame = CFrame.new(duck.CFrame.p, (torso.CFrame).p)
  939.                         duck.CFrame = duck.CFrame * CFrame.new(0,0,(-1*speed)) * CFrame.Angles(0,math.rad(rot/math.pi),0) --waddle waddle, and he waddled away
  940.                        
  941.                         if ((duck.CFrame.p) - torso.CFrame.p).magnitude <=3.5+duck.Size.z/2 then
  942.                             local mp = utils.MidPoint(duck.CFrame.p,torso.CFrame.p)
  943.                             local e = Instance.new('Explosion',Workspace)
  944.                             e.Position = mp
  945.                             e.Hit:connect(function(v) pcall(function()v:BreakJoints()end) end)
  946.                                 --local mini = {0.05,0.1,0.2,0.15,0.25}
  947.                                 local colors = {'Bright orange','Bright yellow', 'Bright yellow', 'Bright yellow'}
  948.                                 for i = 1,math.random(6,15) do
  949.                                     local confetti = Instance.new('Part',Workspace)
  950.                                     confetti.FormFactor = 'Custom'
  951.                                     confetti.Size = Vector3.new(.5,.5,.5)
  952.                                     confetti.BrickColor = BrickColor.new(colors[math.random(1,#colors)])
  953.                                     confetti.CFrame = CFrame.new(mp) * utils.RandomCFrame(.02,200) * utils.RandomCFrameAngles(5,72,true)
  954.                                     Debris:AddItem(confetti,math.random(5,10))
  955.                                    
  956.                                     local sparkles = Instance.new('Sparkles',confetti)
  957.                                     sparkles.Color = Color3.new(0,0.8,0.85)
  958.                                    
  959.                                     local fire = Instance.new('Fire',confetti)                                 
  960.                                    
  961.                                     explosionSound:Play()
  962.                            
  963.                                  end
  964.                                 duck:remove()
  965.                                 pcall(function()v.Character:BreakJoints()end)
  966.                             break
  967.                         end
  968.                     end
  969.                 end)(duck,torso,explosionSound,m)
  970.                
  971.             else           
  972.                
  973.             end
  974.  
  975.     end
  976.    
  977. end,1,
  978. 'sd','rocket','rpd')
  979.  
  980.  
  981. addCommand('ForceField','Puts a ff on specified player(s)',
  982.     function(str,chatter)
  983.         local plrs = utils.GetPlayersFromString(str,chatter)
  984.         for _,v in pairs(plrs) do
  985.             if v.Character ~= nil then
  986.                 Instance.new('ForceField',v.Character)
  987.                 Tabby('Gave ForceField to: '..tostring(v.Name), clickremove,chatter,15,'Bright blue')
  988.             end
  989.         end
  990.     end,1
  991. ,'ff','fof')
  992.  
  993. addCommand('Message','Messages player(s) with a tabby',
  994.     function(str,chatter)
  995.         local str_tab = utils.split(str," ")
  996.         if (not str_tab[1] or not str_tab[2]) then return end
  997.         local plrs = str:match("==([%s%d%a%p]+)==")
  998.         local reiterate = tonumber(str:match("=(%d+)=")) or 1
  999.        
  1000.         if not plrs then return end
  1001.         local length = (string.len(plrs)+2)+1
  1002.         --local text = string.sub(str,length,string.len(str))
  1003.         local str =(str:gsub('==([%s%d%a%p]+)==',"")):gsub("=(%d+)=","")
  1004.         local plrs = utils.GetPlayersFromString(plrs,chatter)
  1005.         for _,v in pairs(plrs) do
  1006.             if checkAlive(v) then
  1007.                 for i = 1, reiterate do
  1008.                 Tabby(str,clickremove,v,15,'Bright green')
  1009.                 end
  1010.             end
  1011.         end
  1012.     end,
  1013.     1,'msg','mg','m'
  1014. )
  1015. addCommand('FallingDucks','Spawns exploding ducks in the air for specified time',
  1016.     function(str,chatter)
  1017.         local str = str:lower()
  1018.         local str_tab = utils.split(str," ")   
  1019.        
  1020.         local numb = tonumber(str_tab[1])
  1021.         local str = tostring(str_tab[2])       
  1022.         local plrz = tostring(str_tab[3])
  1023.        
  1024.         if plr ~= nil then
  1025.             local length = string.len(numb) + string.len(str) + 2
  1026.             plrz = string.sub(str,length,string.len(str))
  1027.         end
  1028.        
  1029.        
  1030.         local pos = {}
  1031.  
  1032.         if plrz ~= nil then
  1033.  
  1034.             local a = utils.GetPlayersFromString(plrz,chatter)
  1035.            
  1036.             for _,v in pairs(a) do
  1037.                
  1038.                  local alive,character,head,torso,neck,humanoid = checkAlive(v)
  1039.                
  1040.                 if alive then
  1041.                     table.insert(pos,torso.CFrame.p)
  1042.                     Tabby('Let ducks fall upon: '..utils.VectorToString(torso.CFrame.p), clickremove,chatter,15,'Bright blue')
  1043.                 end
  1044.             end
  1045.         end
  1046.        
  1047.         if numb ~= nil then
  1048.            
  1049.             if type(numb) == 'number' then
  1050.                            
  1051.                 local function convert(n,str)
  1052.                    
  1053.                     if str ~= nil then
  1054.                         if string.sub(str,1,3) == 'sec' then return 1 * n
  1055.                             elseif string.sub(str,1,3) == 'min' then return 60 * n
  1056.                             elseif string.sub(str,1,4) == 'hour' then return 360 * n
  1057.                             elseif string.sub(str,1,3) == 'day' then return 8640 * n
  1058.                             else return n * 1
  1059.                         end
  1060.                     else return n * 1
  1061.                 end
  1062.  
  1063.                 end            
  1064.                
  1065.                 local tim = convert(numb,str)
  1066.                
  1067.                 if #pos >= 1 then
  1068.                     for _,v in pairs(pos) do
  1069.                         coroutine.wrap(function(tim,v)
  1070.                    
  1071.                             for rep = 1,tim do
  1072.                                 wait(1)
  1073.                                 local duck = Instance.new('Part',Workspace)
  1074.                                
  1075.                                 local m = Instance.new('SpecialMesh',duck)
  1076.                                 m.MeshId = "http://www.roblox.com/asset/?id=9419831";
  1077.                                 m.TextureId = "http://www.roblox.com/asset/?id=9419827";
  1078.                                 m.Scale = Vector3.new(2,2,2)
  1079.                                
  1080.                                 duck.CFrame = CFrame.new(v + Vector3.new(math.random(-20,20),math.random(50,70),math.random(-20,20)))
  1081.                                 duck.Velocity = (v - duck.CFrame.p).unit * math.random(1,100)
  1082.                                 duck.RotVelocity = utils.RandomVector(1,20)
  1083.                                 duck.Name = 'Duck'
  1084.                                
  1085.                                 duck.Touched:connect(function(h)
  1086.                                 if h.Name ~= 'Duck' and h.Name ~= 'Confetti' and h.Name ~= 'Handle' then
  1087.                                 --local mini = {0.05,0.1,0.2,0.15,0.25}
  1088.                                 local colors = {'Bright orange','Bright yellow', 'Bright yellow', 'Bright yellow'}
  1089.                                 coroutine.wrap(function(duck)
  1090.                                 local ex = Instance.new('Explosion',Workspace)
  1091.                                 ex.Position = duck.CFrame.p
  1092.                                 for i = 1,math.random(1,3) do
  1093.                                     wait()
  1094.                                     local confetti = Instance.new('Part',Workspace)
  1095.                                     confetti.FormFactor = 'Custom'
  1096.                                     confetti.Size = Vector3.new(.5,.5,.5)
  1097.                                     confetti.BrickColor = BrickColor.new(colors[math.random(1,#colors)])
  1098.                                     confetti.CFrame = duck.CFrame * utils.RandomCFrame(.02,200) * utils.RandomCFrameAngles(5,72,true)
  1099.                                     confetti.Name = 'Confetti'
  1100.                                     Debris:AddItem(confetti,math.random(5,10))
  1101.                                    
  1102.                                     local sparkles = Instance.new('Sparkles',confetti)
  1103.                                     sparkles.Color = Color3.new(0,0.9,0.85)
  1104.                                    
  1105.                                     local fire = Instance.new('Fire',confetti)                                 
  1106.                                  end
  1107.                                
  1108.                                     duck:remove()
  1109.                                 end)(duck)
  1110.                                 end
  1111.                                 end)                   
  1112.                                
  1113.                             end
  1114.                    
  1115.                         end)(tim,v)
  1116.                     end
  1117.                 end
  1118.                
  1119.             end
  1120.         end
  1121.     end,2,
  1122. 'falld','fds','meteorshower','quackshower')
  1123.  
  1124. addCommand('SwearIn','Swears in player(s) as a member of the duckerz',
  1125.     function(str,chatter)
  1126.         local plrs = utils.GetPlayersFromString(str,chatter)
  1127.         for _,v in pairs(plrs) do
  1128.             if getRank(v.Name) <= 0 then
  1129.             addPlayer(v.Name,1)
  1130.             checkPlayer(v)
  1131.                 if checkAlive(v)  then
  1132.                     local name = tostring(v.Name)
  1133.                     Tabby(name..', you are now a duckerz!',clickremove,v,15,'Bright green')
  1134.                 end
  1135.             end
  1136.         end
  1137.     end,3,
  1138. 'admin','duckize','add')
  1139.  
  1140. --[[
  1141. local mouse = Players.LocalPlayer:GetMouse()
  1142.  
  1143.  
  1144. local chatGUI=Instance.new('ScreenGui',Players.LocalPlayer.PlayerGui)
  1145. local chatBox=Instance.new('TextBox',chatGUI)
  1146. chatBox.FontSize = Enum.FontSize.Size24;
  1147. chatBox.TextWrap = true;
  1148. chatBox.Text = "/";
  1149. chatBox.BorderSizePixel = 0;
  1150. chatBox.Size = UDim2.new(0, 815, 0, 50);
  1151. chatBox.TextColor3 = Color3.new(0, 0, 0);
  1152. chatBox.BackgroundTransparency = 1;
  1153. chatBox.Font = Enum.Font.SourceSansBold;
  1154. chatBox.Position = UDim2.new(0, 25, 0, 0);
  1155. chatBox.BackgroundColor3 = Color3.new(1, 1, 1);
  1156.  
  1157. chatBox.FocusLost:connect(function(pressed)
  1158.     if not pressed then return end
  1159.     local str = tostring(chatBox.Text)
  1160.     local first = str:match('[^;,! ]+')
  1161.     local after = string.sub(str,string.len(first)+2,string.len(str))
  1162.     local prompt = COMMANDS[first]
  1163.     if prompt then
  1164.         prompt.Run(after, Players.LocalPlayer)
  1165.     end
  1166. end)
  1167.  
  1168. mouse.KeyDown:connect(function(key)
  1169.     key = key:lower()
  1170.     if string.byte(key) == 92 then --\
  1171.     chatBox:CaptureFocus()
  1172. end
  1173. end)
  1174. ]]--
  1175.  
  1176. function checkPlayer(plr)
  1177.     if getRank(plr.Name)>0 then
  1178.         GiveChat(plr)
  1179.     elseif getRank(plr.Name)<0 then
  1180.         pcall(function()
  1181.             plr.Parent = nil
  1182.             plr:remove()
  1183.             plr:destroy()
  1184.             plr:Kick()
  1185.         end)
  1186.     end
  1187. end
  1188.  
  1189. function GiveChat(plr)
  1190.    
  1191.     plr.Chatted:connect(function(str)
  1192.     local first = str:match('[^;,!/\ ]+')
  1193.     local after = string.sub(str,string.len(first)+2,string.len(str))
  1194.     local plrRank = getRank(plr.Name)
  1195.     local prompt = COMMANDS[first]
  1196.     if prompt then
  1197.         if prompt.Rank <= plrRank then
  1198.             prompt.Run(after, plr)
  1199.         else
  1200.             Tabby('YOU DO NOT HAVE PERMISSION!', clickremove,plr,15,'Bright red')
  1201.         end
  1202.     else
  1203.         local str = utils.encode(str)
  1204.         local apple = utils.decode(str)
  1205.         ChatService:Chat(plr.Character.Head,apple)  --I have no idea
  1206.     end
  1207.     end)
  1208. end
  1209.  
  1210. for _,v in pairs(Players:GetPlayers()) do checkPlayer(v) end
  1211. Players.PlayerAdded:connect(function(plr) checkPlayer(plr) end)
  1212.  
  1213. local rot=0
  1214.  
  1215.  
  1216. coroutine.resume(coroutine.create(function()
  1217.             RunService.Stepped:connect(function()
  1218.                
  1219.                 for i=1,#TABS do  -- I tried ... ._.
  1220.                 if TABS[i] == nil then
  1221.                 table.remove(TABS,i)
  1222.                 else
  1223.  
  1224.                     if (TABS[i]:FindFirstChild('Player')) ~= nil then
  1225.                         local plr = Players:FindFirstChild(TABS[i].Player.Value)
  1226.                         if not plr then table.remove(TABS,i);pcall(function()TABS[i]:remove()end)  end
  1227.                     end
  1228.  
  1229.                 end
  1230.                 end            
  1231.                 rot=(rot % 360) + .0005
  1232.                 for i,v in pairs(TABS) do --spiiny stolen from som1 :P
  1233.                     local val = v:FindFirstChild('Player')
  1234.                     if v ~= nil and val ~= nil  then
  1235.                         if Players:FindFirstChild(val.Value) ~= nil then
  1236.                         local plr = Players:FindFirstChild(val.Value)
  1237.                          if plr.Character ~= nil then
  1238.                             if plr.Character:FindFirstChild('Torso') ~= nil then
  1239.                                 local tabbies = {}                             
  1240.                                 for ii,xx in  pairs(v:GetChildren()) do
  1241.                                     if xx.Name == '.__.' then
  1242.                                         table.insert(tabbies,xx)
  1243.                                     end
  1244.                                 end
  1245.                                 for i = 1,#tabbies do
  1246.                                     if tabbies[i] == nil then
  1247.                                         table.remove(tabbies,i);
  1248.                                     end
  1249.                                 end
  1250.                                     for i_i,x_x in pairs(tabbies) do
  1251.                                     local pos = plr.Character.Torso.CFrame
  1252.                                     local a = #tabbies         
  1253.                                     local radius = math.pi + a
  1254.                                     local x = math.sin((i_i / a - (0.5 / a) + rot * 2) * math.pi * 2) * radius
  1255.                                     local y = math.tan((i_i / a - (0.5 / a) + rot * 2) * math.pi * 2) * radius
  1256.                                     local z = math.cos((i_i / a - (0.5 / a) + rot * 2) * math.pi * 2) * radius
  1257.                                     local arot = Vector3.new(x, 0, z) + pos.p
  1258.                                     local brot = x_x.CFrame.p
  1259.                                     local crot = (arot * .1 + brot * .9)
  1260.  
  1261.  
  1262.                                     x_x.CFrame = CFrame.new(crot, pos.p)
  1263.                                     --x_x.CFrame = v.CFrame*CFrame.Angles(0,math.rad(1),0)
  1264.                                     end--loop
  1265.                    
  1266.                             else table.remove(TABS,i); v:remove()
  1267.                             end--does plr have torso?
  1268.                             else  table.remove(TABS,i); v:remove()
  1269.                         end--does plr have char?
  1270.                         else  table.remove(TABS,i); v:remove()
  1271.                         end--is dere aplyer?
  1272.                         else table.remove(TABS,i); v:remove()
  1273.                     end--is there a modle?
  1274.            
  1275.                    
  1276.                 end
  1277.                
  1278.                 end)
  1279.         end
  1280.     )
  1281. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement