Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _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
- math.randomseed(tick())
- --[[
- Oh hi there, this is a beta version of my duck commands...
- It doesn't have alot of commands, but there are a lot more to come.
- --cxcharlie/howamisupposedtoknow
- The current commands are:
- Commands - Displays the commands
- cmds --> cmds pop up
- When the cmds are displayed, you can click on one to see its description and aliases
- Aliases are other words that can be used for a single command,
- for example, instead of using "forcefield me", you can use "ff me"
- If you are a tempa admin (admins added through the "swear in" cmd),
- some of the cmds may appear to be red, that means you do not have permission to use the command
- Makeduck - Makes a duck (very buggy, might remove later)
- "makeduck" -->makes a duck that moves around
- --Touching the duck will result in an explosion
- DuckOut - Pings a duck tab with your message
- "duckout hi im a duck" --> makes a duck tab pop up saying "hi im a duck"
- You can also do: duckout =3= hi im a duck --> makes three tabs saying "hi im a duck"
- Kill - Kills a player
- "kill all" -->kills everyone
- Swarm - Sends a flying duck after someone. If it gets close enough it blows them up
- "swarm bob" --> sends duck after bob
- Message - Makes a message for specified players
- Arguments: [==players==] [=reiterate number=]
- "Message ==bob== hi" --> makes a duck tab on bob saying "hi"
- You can also do: "Message ==bob,me== =3= hi" --> makes three ducks saying "hi" for bob and me
- The order of the "== ==" and the "= =" doesn't matter
- Forcefield - Gives specified player(s) a forcefield...
- (Yes this is cliche)
- "forcefield me,bob" --> gives bob and me a ff
- SwearIn - Swears player(s) to a duckzer [admin]
- "swearin bob" --> admins bob, and bob can now use commands
- FallingDucks - Makes ducks fall and explode for specifed player(s) and time
- Arguments: [time] [players]
- time: secs,hours,days
- "fallingducks 20 sec bob" -->
- for 20 seconds, there will be falling ducks on the specified player(s)
- location
- "fallingducks 20 hours bob" --> 20 hours of falling ducks -_-
- "fallingducks 20 days bob" --> yeah...
- Dismiss - Removes all the tabs from specified player(s)
- dismiss all --> removes the players' tabs
- If you just say "dismiss" then it will dismiss you
- ]]--
- --local print = require(game:GetService("ReplicatedStorage"):WaitForChild("OCServer").PrintFunction)
- local Workspace = Game:GetService('Workspace')
- local Players = Game:GetService('Players')
- local ReplicatedStorage = game:GetService('ReplicatedStorage')
- local HttpService = game:GetService('HttpService')
- local ServerScriptService = game:GetService('ServerScriptService')
- local ServerStorage = game:GetService('ServerStorage')
- local StarterPack = Game:GetService('StarterPack')
- local StarterGui = Game:GetService('StarterGui')
- local Lighting = Game:GetService('Lighting')
- local Debris = Game:GetService('Debris')
- local Teams = Game:GetService('Teams')
- local BadgeService = Game:GetService('BadgeService')
- local InsertService = Game:GetService('InsertService')
- local Terrain = Workspace.Terrain
- local RunService = Game:GetService('RunService')
- local Soundscape = Game:GetService('SoundService')
- local TeleportService = Game:GetService('TeleportService')
- local ChatService = Game:GetService('Chat')
- local ColorMeta = {
- __add = function(v1,v2)
- if (not v2 or not v2) then return end
- 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
- return Color3.new((v1[1]+v2[1])%1,(v1[2]+v2[2])%1,(v1[3]+v2[3])%1)
- end,
- __sub = function(v1,v2)
- if (not v2 or not v2) then return end
- 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
- return Color3.new(math.max(0,v1[1]-v2[1]),math.max(0,v1[2]-v2[2]),math.max(0,v1[3]-v2[3]))
- end
- }
- local custom = {
- {'ByteDino',3}, -- [name, rank] (3 is highest rank, 2 is friends, 1 is temp admin, and 0 is normal player, and <= -1 is banned
- {'PlayerName',2},
- {'cxcharlie',3},
- }
- local LIST = setmetatable({},{
- __index = function(self,index)
- for _,v in pairs(self) do
- if string.lower(v.Name) == string.lower(tostring(index)) then
- return v
- end
- end
- end,
- __newindex = function(self,index,value)
- if value.Rank > 3 then
- value.Rank = 3 -- -_-
- print('really?')
- rawset(self,index,value)
- else
- rawset(self,index,value)
- end
- end,
- }
- )
- function addPlayer(name,rank)
- local new = {Name = name, Rank = rank}
- rawset(LIST,name,new) --if needed there's a return :P
- end
- function getRank(name)
- if LIST[name] then
- return LIST[name].Rank
- else
- return 0
- end
- end
- for index,derp in pairs(custom) do pcall(function() addPlayer(derp[1],derp[2]) end) end --close enough
- local VerifyArg
- local TABS = {}
- local nilCMD = {Name = 'nil'; Description = 'nil' ; Aliases = {}}
- local COMMANDS = setmetatable({},
- {__index = function(self,index)
- for _,v in pairs(self) do
- for __,vv in pairs(v.Aliases) do
- if string.lower(vv) == string.lower(tostring(index)) then
- return v
- end
- end
- if v.Name:lower() == index:lower() or rawget(self,index) then
- return v
- end
- end
- return nilCMDS
- end
- }
- )
- --local alive,character,head,torso,neck,humanoid = checkAlive(plr)
- function checkAlive(plr)
- local character,head,torso,neck,humanoid = nil,nil,nil,nil,nil
- local character = plr.Character
- if character then
- head = character:FindFirstChild('Head')
- torso = character:FindFirstChild('Torso')
- humanoid = character:FindFirstChild('Humanoid')
- if (head and torso and humanoid) then
- neck = torso:FindFirstChild('Neck')
- end
- end
- if neck then
- return true,character,head,torso,neck,humanoid
- else
- return false
- end
- end
- local clickremove = function(tab,model)
- for _,v in pairs(model:GetChildren()) do
- if v == tab then
- tab:remove()
- break
- end
- end
- end
- function dismiss(_,__,player)--idk :P
- for _,v in pairs(Workspace:GetChildren()) do
- if v.ClassName == 'Model' then
- if v.Name == '__Tab' then
- if v.Player ~= nil then
- local name = v.Player.Value
- local plr = Players:FindFirstChild(name)
- if plr ~= nil then
- if plr == player then
- for __,v2 in pairs(TABS) do
- if v2 == v then
- table.remove(TABS,__)
- v:remove()
- break
- end
- end
- end
- end
- end
- end
- end
- end
- end
- function Tabby(str,funct,plr,d,bool)
- local function Create(ty)
- return function(data)
- local obj = Instance.new(ty)
- for k, v in pairs(data) do
- if type(k) == 'number' then
- v.Parent = obj
- else
- obj[k] = v
- end
- end
- return obj
- end
- end
- local model
- for _,v in pairs(Workspace:GetChildren()) do
- if v.Name == '__Tab' then
- if v:FindFirstChild('Player') ~= nil then
- local p = v.Player.Value
- local test = Players:FindFirstChild(p)
- if test then
- if test == plr then
- model = v
- break
- end
- end
- end
- end
- end
- if not model then
- model = Instance.new('Model',Workspace); model.Name = '__Tab'
- local sv = Instance.new('StringValue',model) sv.Value = tostring(plr.Name)
- sv.Name = 'Player'
- end
- coroutine.wrap(function(plr,model)
- plr.Character.Humanoid.Died:connect(function()
- model:remove()
- end)
- end)(plr,model)
- local tab = Create'Part'{
- Parent = model;
- Anchored = true;
- FormFactor = 'Custom';
- Size = Vector3.new(4, 4.80000019, 2);
- Name = ".__.";--idk
- CanCollide = false;
- Locked = true;
- Create'SpecialMesh'{ --duck mesh :333
- Name = 'MESH';
- Scale = Vector3.new(2, 2, 2);
- MeshId = "http://www.roblox.com/asset/?id=9419831";
- TextureId = "http://www.roblox.com/asset/?id=9419827";
- MeshType = Enum.MeshType.FileMesh;
- };
- };
- if bool then
- local sl = Instance.new('SelectionBox',tab)
- sl.Color = BrickColor.new(bool);sl.Adornee = tab
- end
- local bbg = Instance.new('BillboardGui',tab)
- bbg.AlwaysOnTop = true
- --local bv = Instance.new('BoolValue',tab); bv.Name = 'Ready'; bv.Value = true
- local sound = Instance.new('Sound',tab); sound.SoundId='' sound.Name = 'Quack'
- local sound2 = Instance.new('Sound',tab); sound2.SoundId=''; sound2.Name = 'Quack2'
- bbg.Size = UDim2.new(0, 300, 0, 1);bbg.StudsOffset = Vector3.new(0,5,0);bbg.Adornee = tab
- local tl = Instance.new('TextLabel',bbg)
- tl.BackgroundTransparency = 1;tl.Size = UDim2.new(0, 300, 0, 100);tl.Font = Enum.Font.SourceSansBold;tl.FontSize = Enum.FontSize.Size24;
- 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}
- 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)])
- if type(str) == 'string' then
- tl.Text = str
- elseif type(str) == 'table' then
- tl.Text = str.Name
- end
- local h = Instance.new('Handles',tab)
- h.Faces = Faces.new(Enum.NormalId.Top);h.Adornee = tab
- local cd = Instance.new('ClickDetector',tab)
- cd.MaxActivationDistance = 9999
- table.insert(TABS,model)
- local index = 0
- for _,v in pairs(model:GetChildren()) do if v == tab then index = _ break end end
- coroutine.wrap(function(plr,cd,funct,tab,model,index,str)
- cd.MouseClick:connect(function(clicker)
- if type(str) == 'string' then
- if clicker == plr then
- funct(tab,model,plr,index)
- else
- if plr and clicker then
- if plr.Character and clicker.Character then
- local ff = Debris:AddItem(Instance.new('ForceField',plr.Character),math.random(2,4))
- local ex = Instance.new('Explosion',Workspace)
- ex.Position = clicker.Character:FindFirstChild('Torso').CFrame.p or click.Character:FindFirstChild('Head').CFrame.p or Vector3.new(0,0,0)
- end
- end
- end
- elseif type(str) == 'table' then
- if clicker == plr then
- dismiss(nil,nil,plr)
- local ARGS = 'Aliases: '..tostring(table.concat(str.Aliases,'/'))
- Tabby(ARGS,clickremove,plr,20,'Bright orange')
- Tabby(str.Description,clickremove,plr,20,'Bright green')
- Tabby('Back',displayRecurse,plr,20,'Bright blue')
- Tabby('Exit',dismiss,plr,20,'Bright red')
- end
- end
- end)
- end)(plr,cd,funct,tab,model,index,str)
- Delay(d,function()for _,v in pairs(TABS) do if v == tab then table.remove(TABS,_) end end tab:remove()end)
- end
- local starter = [[
- _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
- math.randomseed(tick())
- local Workspace = Game:GetService('Workspace')
- local Players = Game:GetService('Players')
- repeat wait() until Players.LocalPlayer
- local ReplicatedStorage = game:GetService('ReplicatedStorage')
- local HttpService = game:GetService('HttpService')
- local ServerScriptService = game:GetService('ServerScriptService')
- local ServerStorage = game:GetService('ServerStorage')
- local StarterPack = Game:GetService('StarterPack')
- local StarterGui = Game:GetService('StarterGui')
- local Lighting = Game:GetService('Lighting')
- local Debris = Game:GetService('Debris')
- local Teams = Game:GetService('Teams')
- local BadgeService = Game:GetService('BadgeService')
- local InsertService = Game:GetService('InsertService')
- local Terrain = Workspace.Terrain
- local RunService = Game:GetService('RunService')
- local Soundscape = Game:GetService('SoundService')
- local TeleportService = Game:GetService('TeleportService')
- ]]
- local utils = {}
- function utils.split(str,div)--took dis from someone :3
- local results = {}
- local currentresult = ""
- for i=1,string.len(str) do
- local current = string.sub(str,i,i)
- if current:match(div) then
- table.insert(results,currentresult)
- currentresult = ""
- else
- currentresult = currentresult..current
- end
- end
- table.insert(results,currentresult)
- return results
- end
- function utils.catcha(f,plr)
- --local s,e = ypcall(f)
- --if not s then
- -- Tabby("ERROR: "..(tostring(e)),clickremove,plr,20,'Bright red')
- --end
- end
- function utils.MidPoint(p1,p2)
- return Vector3.new((p1.x+p2.x)/2,(p1.y+p2.y)/2,(p1.z+p2.z)/2)
- end
- function utils.PON(n)
- return ((n>0 and 'Pos') or (n<0 and 'Neg') or (n == 0 and 'Zero'))
- end
- function utils.RandomNumber(m,maximum)
- local possible = {}
- for i = -maximum,maximum,m do
- table.insert(possible,m * i)
- end
- return possible[math.random(#possible)]
- end
- function utils.RandomVector(m,maximum) --multiples, max amount
- local possible = {}
- for i = -maximum,maximum,m do
- table.insert(possible,m * i)
- end
- return Vector3.new(possible[math.random(1,#possible)],possible[math.random(1,#possible)],possible[math.random(1,#possible)])
- end
- function utils.RandomCFrame(m,maximum) --multiples, max amount
- local possible = {}
- for i = -maximum,maximum,m do
- table.insert(possible,m * i)
- end
- return CFrame.new(possible[math.random(1,#possible)],possible[math.random(1,#possible)],possible[math.random(1,#possible)])
- end
- function utils.RandomCFrameAngles(m,maximum,bool) --multiples, max amount, if bool, then convert to radians
- local possible = {}
- for i = -maximum,maximum,m do
- if bool then
- table.insert(possible,math.rad(m * i))
- else
- table.insert(possible,m * i)
- end
- end
- return CFrame.Angles(possible[math.random(1,#possible)],possible[math.random(1,#possible)],possible[math.random(1,#possible)])
- end
- function utils.DrawRay(ray, parent, color)
- if not parent then parent = workspace end
- local part = Instance.new("Part", parent)
- part.FormFactor = "Custom"
- part.Size = Vector3.new(.2, ray.Direction.magnitude, .2)
- part.CFrame = CFrame.new(ray.Origin + ray.Direction/2, ray.Origin + ray.Direction) * CFrame.Angles(math.pi/2,0,0)
- part.Anchored = true
- part.CanCollide = false
- Instance.new("SpecialMesh", part)
- if not color then
- part.BrickColor = BrickColor.new("Bright red")
- else
- part.BrickColor = BrickColor.new(color)
- end
- return part
- end
- function utils.VectorToString(Vector)
- return ("Vector3.new("..Vector.x..", "..Vector.y..", "..Vector.z..")")
- end
- debug = false
- --THANKS ALOT TO jacob2233 FOR THIS ALGORITHM! :D
- function utils.encode(phrase)
- r = #phrase --Number of letters in the phrase
- isOdd = false --Default; if true then at the end add a letter ot notify the decompiler
- if r%2 ~= 0 then --If the amount of letters is odd then...
- phrase = phrase.." " --Add a space to the end if the phrase has an odd amount of letters
- isOdd = true --Remember to add a letter at the end for the decompiler to see
- end
- i = 1 --Keeps track of current iteration
- code = 0 --Code can't be null, so start with 0; The 0 will be removed later
- while i <= #phrase do --Repeat until 'i' is greater than the amount of letters
- a = string.byte(string.sub(phrase,i,i+1)) --Translate first letter into ASCII value
- b = string.byte(string.sub(phrase,i+1,i+2)) --Translate second letter into ASCII value
- temp = utils.encodeAB(a,b) --Encode the temporary group for quick access and efficiency
- if temp<10 then --There is no way for the decoder to know if a value is < 10
- l1 = string.char(math.random(97,102)) --Pick a random letter from 'a' to 'f'
- code = code..l1..temp --Add the quick hint for the decompiler
- if debug then print(a.." "..b.." "..l1..temp) end --Debug
- elseif temp<1000 then --There is no way for the decoder to know if a value is < 1000
- l1 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
- code = code..l1..temp --Add the quick hint for the decompiler
- if debug then print(a.." "..b.." "..l1..temp) end --Debug
- elseif temp<10000 then --There is no way for the decoder to know if a value is < 10000
- l1 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
- l2 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
- code = code..l1..l2..temp --Add the quick hint for the decompiler
- if debug then print(a.." "..b.." "..l1..l2..temp) end --Debug
- elseif temp>100000 then --There is no way for the decoder to know if a value is > 100000; encode(255,255) is 130560
- l1 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
- l2 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
- l3 = string.char(math.random(65,70)) --Pick a random letter from 'A' to 'F'
- code = code..l1..l2..l3..temp --Add the quick hint for the decompiler
- if debug then print(a.." "..b.." "..l1..l2..l3..temp) end --Debug
- else --Most numbers will fall between 10000 and 100000
- code = code..temp --Encode the two individual numbers into one and add it to the result
- if debug then print(a.." "..b.." "..temp) end --Debug
- end
- i = i + 2 --Increment 'i' by two for the next group
- end
- if isOdd then --If the sequence is odd
- code = code..string.char(math.random(65,70)) --Pick a random letter to notify the decompiler of odd lettered phrase
- end
- return string.sub(code,2,#code) --Return the code except for the 0 at the beginning.
- end
- function utils.encodeAB(a,b)
- return 0.5*(math.pow(a+b,2)+3*a+b) --The algorithm itself is simple...
- end
- function utils.decode(input)
- i = 1 --Keeps count of the current iteration
- result = ""
- trimSpace = false --Default; is true if input has odd amount of letters
- if isLetter(string.sub(input, #input-1, #input)) then --If the last element is a letter
- input = string.sub(input,1,#input-1) --Remove the letter
- trimSpace = true --Remember to trim the extra space at the end
- end
- while i<=#input do
- length = 4 --Length of regular number is 5-1 or 4
- if isLetter(string.sub(input,i,i+1)) then --If there is one letter
- if isLetter(string.sub(input,i+1,i+2)) then --If there are two letters
- if isLetter(string.sub(input,i+2,i+3)) then --If there are three letters (max amount of letters)
- length = 5 --Length of long number is 6-1 or 5
- letters = 3 --Amount of letters before the number
- j = i+letters --Account for the letters
- if debug then print(length.." "..string.sub(input,j,j+length)) end --Debug
- group = utils.decodeA(string.sub(input,j,j+length)) --Decode the number into its original two numbers
- i = i+letters+length+1 --Increment 'i' accordingly
- if debug then print(i) end --Debug
- else --Two letters
- length = 3 --Length of short number is 4-1 or 3
- letters = 2 --Amount of letters before the number
- j = i+letters --Account for the letters
- if debug then print(length.." "..string.sub(input,j,j+length)) end --Debug
- group = utils.decodeA(string.sub(input,j,j+length)) --Decode the number into its original two numbers
- i = i+letters+length+1 --Increment 'i' accordingly
- if debug then print(i) end --Debug
- end
- else --One letter
- if isLowerCase(string.sub(input,i,i+1)) then --Lowercase letters mean something different than uppercase letters
- length = 0 --Length of super-short number is 1-1 or 0
- letters = 1 --Amount of letters before the number
- j = i+letters --Account for the letters
- if debug then print(length.." "..string.sub(input,j,j+length)) end --Debug
- group = utils.decodeA(string.sub(input,j,j+length)) --Decode the number into its original two numbers
- i = i+letters+length+1 --Increment 'i' accordingly
- if debug then print(i) end --Debug
- else
- length = 2 --Length of shorter number = 3-1 or 2
- letters = 1 --Amount of letters before the number
- j = i+letters --Account for the letters
- if debug then print(length.." "..string.sub(input,j,j+length)) end --Debug
- group = utils.decodeA(string.sub(input,j,j+length)) --Decode the number into its original two numbers
- i = i+letters+length+1 --Increment 'i' accordingly
- if debug then print(i) end --Debug
- end
- end
- else --No letters
- if debug then print(length.." "..string.sub(input,i,i+length)) end --Debug
- group = utils.decodeA(string.sub(input,i,i+length)) --Decode the number into its original two numbers
- i = i+length+1 --Increment 'i' accordingly
- if debug then print(i) end --Debug
- end
- result = result..string.char(group[1])..string.char(group[2]) --Turn the numbers back into letters and add them to the result
- end
- if trimSpace then
- result = string.sub(result,1,#result-1) --Remove the extra element at the end
- end
- return tostring(result) --Finally, return the fully decoded result
- end
- function utils.decodeA(f)
- F = 2*f
- s = math.floor(math.sqrt(F)) --incase sqrt(F) isn't an integer, make it one.
- S = (s*s)+s
- if F >= S then --case one
- a = f - 0.5*s*(s+1)
- b = 0.5*s*(s+3) - f
- elseif F < S then --case two
- a = f - 0.5*s*(s-1)
- b = 0.5*s*(s+1) - f - 1
- else --Bad value given; only reached if f is negative or not an integer.
- a = -1
- b = -1
- end
- return {a,b} --return a 2 element array (or matrix) containing a and b
- end
- function isLetter(a)
- a,b = pcall(function() return a+1 end) --'a' stores whether the function executed or not; b stores error message
- return not a --return the opposite whether the function worked or not
- end
- function isLowerCase(a)
- return string.lower(a) == a --Compare the input is equal to its lower-case counterpart
- end
- function utils.GetPlayersFromString(str,spokenplayer)
- if not str or str == "" then
- Tabby(("No player string, (arg1 of utils.GetPlayerFromString..."),clickremove,spokenplayer,10,'Bright red')
- end
- if not spokenplayer then
- Tabby(("No specified player (arg2 of utils.GetPlayerFromString..."),clickremove,spokenplayer,10,'Bright red')
- end
- local foundplayers = {}
- for listedplayer in str:lower():gmatch("[^,;!/\ ]+") do
- if listedplayer:lower() == "all" then
- for _,i in pairs(Players:GetPlayers()) do
- table.insert(foundplayers,i)
- end
- elseif listedplayer:lower() == "others" then
- for _,i in pairs(Players:GetPlayers()) do
- if i.Name:lower() ~= spokenplayer.Name:lower() then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "admins" then
- for _,i in pairs(Players:GetPlayers()) do
- if LIST[i.Name] ~= nil then
- if LIST[i.Name] == true then
- table.insert(foundplayers,i)
- end
- end
- end
- elseif listedplayer:lower() == "nonadmins" then
- for _,i in pairs(Players:GetPlayers()) do
- if LIST[i.Name] == nil or LIST[i.Name] == false then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "random" then
- table.insert(foundplayers,Players:GetPlayers()[math.random(1,#Players:GetPlayers())])
- elseif listedplayer:lower() == "me" then
- table.insert(foundplayers,spokenplayer)
- elseif listedplayer:lower() == "friends" then
- for _,i in pairs(Players:GetChildren()) do
- if i:IsFriendsWith(spokenplayer.userId) then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "bestfriends" then
- for _,i in pairs(Players:GetChildren()) do
- if i:IsBestFriendsWith(spokenplayer.userId) then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "nonfriends" then
- for _,i in pairs(Players:GetChildren()) do
- if not i:IsFriendsWith(spokenplayer.userId) then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "nonbestfriends" then
- for _,i in pairs(Players:GetChildren()) do
- if not i:IsBestFriendsWith(spokenplayer.userId) then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "nbc" then
- for _,i in pairs(Players:GetChildren()) do
- if i.MembershipType == Enum.MembershipType.None then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "bc" then
- for _,i in pairs(Players:GetChildren()) do
- if i.MembershipType == Enum.MembershipType.BuildersClub then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "tbc" then
- for _,i in pairs(Players:GetChildren()) do
- if i.MembershipType == Enum.MembershipType.TurboBuildersClub then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "obc" then
- for _,i in pairs(Players:GetChildren()) do
- if i.MembershipType == Enum.MembershipType.OutrageousBuildersClub then
- table.insert(foundplayers,i)
- end
- end
- elseif listedplayer:lower() == "anybc" then
- for _,i in pairs(Players:GetChildren()) do
- if i.MembershipType == Enum.MembershipType.OutrageousBuildersClub or i.MembershipType == Enum.MembershipType.TurboBuildersClub or i.MembershipType == Enum.MembershipType.BuildersClub then
- table.insert(foundplayers,i)
- end
- end
- --[[elseif listedplayer:lower():sub(1,4) == "team" then
- local team = listedplayer:lower():sub(6)
- local matchedteam
- for _,i in pairs(Teams:GetChildren()) do
- if i:IsA("Team") then
- if i.Name:lower():sub(1,#team) == team:lower() then
- if not matchedteam then
- matchedteam = i
- else
- error("Team \""..team.."\" is ambiguous.")
- end
- end
- end
- end
- assert(matchedteam,"No teams matching \""..team.."\" found.")
- for _,i in pairs(Players:GetPlayers()) do
- if i.TeamColor == matchedteam.TeamColor then
- table.insert(foundplayers,i)
- end
- end]]
- end
- local currentfoundplayer
- for _,i in pairs(Players:GetPlayers()) do
- if i.Name:lower():sub(1,#listedplayer) == listedplayer:lower() then
- if not currentfoundplayer then
- currentfoundplayer = i
- else
- Tabby((str.." is ambiguous"),clickremove,spokenplayer,10,'Bright red')
- end
- end
- end
- table.insert(foundplayers,currentfoundplayer)
- end
- --assert(foundplayers[1],"No players were found matching \""..str.."\"")
- if foundplayers[1] == nil then Tabby('No players specified...',clickremove,spokenplayer,10,'Bright blue') end
- return foundplayers
- end
- --[[function NLS(source,player,delayTime)
- if script.ClassName == 'LocalScript' then
- local ls = script:Clone() ls.Disabled = true
- ls.Parent = player.Character or player.PlayerGui or player.Backpack or nil
- local code = Instance.new('StringValue',ls) code.Name = 'code'
- code.Value = starter..source
- coroutine.wrap(function(ls,delayTime)
- delay(delayTime,function()ls.Disabled = false end)
- end)(ls,delayTime)
- elseif script.ClassName == 'Script' then
- if script:FindFirstChild('LS') ~= nil then
- local ls = script.LS:Clone()
- ls.Source = starter..source
- ls.Parent = player.Character or player.PlayerGui or player.Backpack or nil
- coroutine.wrap(function(ls,delayTime)
- delay(delayTime,function()ls.Disabled = false end)
- end)(ls,delayTime)
- end
- end
- end
- ]]--
- function addCommand(name,desc,func,rank,...)
- local tuple = {...}
- local new = {Name = name; Description = desc; Run = function(...) func(...) end ; Aliases = tuple; Rank = rank}
- rawset(COMMANDS,name,new)
- end
- addCommand('MakeDuck','Makes a duck',
- function(str,chatter)
- local duck = Instance.new('Model',Workspace)
- duck.Name = 'Duck'
- local torso = Instance.new('Part',duck)
- torso.FormFactor = 'Custom'
- torso.Size = Vector3.new(1.5,1.5,1.5)
- torso.Name = 'Torso'
- torso.Position = Vector3.new(math.random(-20,20),math.random(5,10),math.random(-20,20))
- local quack = Instance.new('Sound',torso)
- quack.SoundId = 'http://www.roblox.com/asset/?id=9413300'
- quack.Volume = 1.1
- local head = Instance.new('Part',duck)
- head.FormFactor = 'Custom'
- head.Size = Vector3.new(.75,.75,.75)
- head.Name = 'Head'
- head.Transparency = 0.9
- head.CanCollide = false
- local weld = Instance.new('Weld',torso)
- weld.Part0,weld.Part1 = torso,head
- weld.C1 = CFrame.new(0,0.33,0)
- local humanoid = Instance.new('Humanoid',duck)
- local m = Instance.new('SpecialMesh',torso)
- m.MeshType = Enum.MeshType.FileMesh
- m.MeshId = "http://www.roblox.com/asset/?id=9419831";
- m.TextureId = "http://www.roblox.com/asset/?id=9419827";
- m.Scale = Vector3.new(1.1,1.1,1.1)
- coroutine.wrap(function(duck,torso,head,humanoid,quack,weld)
- while (duck~=nil and torso~=nil and head~=nil and humanoid~=nil and quack~=nil) do
- wait(.1)
- if not run or not duck or not torso or not head or not weld or not humanoid then break end
- if humanoid.Health<=0 then break end
- local jumpRay = Ray.new(head.CFrame.p,head.CFrame.lookVector*4.3)
- local part,poz = Workspace:FindPartOnRayWithIgnoreList(jumpRay,{duck},true)
- if part then if part.Size.y<=4.5 then humanoid.Jump = true end end
- end
- end)(duck,torso,head,humanoid,quack,weld)
- coroutine.wrap(function(duck,torso,head,weld,humanoid,quack)
- torso.Touched:connect(function(hit)
- local hum = hit.Parent:FindFirstChild('Humanoid')
- if hum then
- --ChatService:Chat(torso,utils.decode('2018325765242042355110043259892121910845241922142023321FA2178F'))
- local ex = Instance.new('Explosion',Workspace)
- ex.Position = hit.Position
- duck:remove()
- end
- end)
- local run = true
- humanoid.Died:connect(function()run=false;end)
- while (duck and torso and head and weld) ~= nil do
- wait(math.random(2,5))
- if not run or not duck or not torso or not head or not weld or not humanoid then break end
- if humanoid.Health<=0 then break end
- local jump = math.random(1,5) if jump == 2 then humanoid.Jump = true end
- 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)
- local rayPart = utils.DrawRay(ray, Workspace)
- Debris:AddItem(rayPart,2)
- local hit,pos = Workspace:FindPartOnRayWithIgnoreList(ray,{duck},true)
- if hit and pos then
- quack.Pitch=utils.RandomNumber(.1,1)+.5 wait();quack:Play()
- humanoid:MoveTo(pos, Terrain)
- end
- end
- end)(duck,torso,head,weld,humanoid,quack)
- end,1,
- 'md','create'
- )
- addCommand('Kill','Kills specified player(s)', function(str,chatter)
- local plrs = utils.GetPlayersFromString(str,chatter)
- for _,v in pairs(plrs) do
- if v.Character ~= nil then
- v.Character:BreakJoints()
- Tabby(('Killed: '..tostring(v.Name)), clickremove,chatter,12,'Bright blue')
- end
- end
- end,1,
- 'kl','die','dk')
- addCommand('DuckOut','Pings a duck tab',function(str,chatter)
- local rep = (str:match('=(%d+)='))
- local str = str:gsub('=(%d+)=',"")
- local str = utils.encode(str:gsub('','\5'))
- for i = 1,(rep or 1) do
- local colors={'Bright green','Bright blue','Bright yellow','Bright orange'}
- Tabby(tostring(utils.decode(str)),clickremove,chatter,30+math.random(1,12),colors[math.random(1,#colors)])
- end
- end,1,
- 'out','quack','du','duck','dd')
- function displayRecurse(_,__,plr)
- dismiss(nil,nil,plr)
- for _,v in pairs(COMMANDS) do
- if v.Rank <= getRank(plr.Name) then
- Tabby(v, nil,plr,30+math.random(1,30),'Bright green')
- else
- Tabby(v, nil,plr,30+math.random(1,30),'Bright red')
- end
- end
- end
- addCommand('Commands','Displays the commands -_-',function(str,chatter)
- displayRecurse(nil,nil,chatter)
- end,1,
- 'cmds','cmd','ducks')
- addCommand('Swarm','Sends a rocket propelled duck at specified player(s)',function(str,chatter)
- local plrs = utils.GetPlayersFromString(str,chatter)
- for _,v in pairs(plrs) do
- local alive,character,head,torso,neck,humanoid = checkAlive(v)
- if alive then
- Tabby('Swarmed: '..tostring(v.Name), clickremove,chatter,15,'Bright blue')
- local duck = Instance.new('Part',Workspace)
- duck.Size = Vector3.new(3,3,3)
- duck.Anchored = true
- duck.CanCollide = false
- duck.Position = torso.CFrame.p + Vector3.new(math.random(-100,100),math.random(0,20),math.random(-100,100))
- duck.Locked = true
- local m = Instance.new('SpecialMesh',duck)
- m.MeshId = "http://www.roblox.com/asset/?id=9419831";
- m.TextureId = "http://www.roblox.com/asset/?id=9419827";
- m.Scale = Vector3.new(3.1,3.1,3.1)
- local sound = Instance.new('Sound',duck)
- sound.SoundId = "http://www.roblox.com/asset/?id=9413300"
- sound.Name = 'LoopQuack'
- sound.Looped = true
- sound:Play()
- local explosionSound = Instance.new('Sound',duck)
- explosionSound.SoundId = 'rbxasset://sounds/collide.wav'
- explosionSound.Name = 'Explosion'
- explosionSound.Pitch = 1.2
- coroutine.wrap(function(duck)
- RunService.Stepped:connect(function()
- pcall(function()
- duck.Anchored = true
- end)
- end)
- end)
- coroutine.wrap(function(duck)
- local lastCF = duck.CFrame
- local lastsize
- local ts = {}
- while duck ~= nil do
- wait()
- if duck == nil then break end
- local current = duck.CFrame
- if current ~= lastCF then
- local distance = (current.p - lastCF.p).magnitude + (.45 * duck.Size.z)
- local trail = Instance.new('Part',Workspace)
- trail.BrickColor = BrickColor.new('Bright yellow')
- trail.Anchored = true
- trail.Transparency = 0.2
- trail.TopSurface,trail.BottomSurface = 'Smooth','Smooth'
- trail.Size = Vector3.new(1,1,distance)
- trail.CFrame = CFrame.new(lastCF.p,current.p) * CFrame.Angles(0,0,distance/2)
- table.insert(ts,trail)
- end
- for _,v in pairs(ts) do
- if v ~= nil then
- v.Transparency = v.Transparency + .1
- if v.Transparency >= 1 then
- table.remove(ts,_)
- v:remove()
- end
- end
- end
- lastCF = duck.CFrame
- end
- end)(duck)
- coroutine.wrap(function(duck,torso,explosionSound,m)
- local start = time()
- local wad = 0
- local bool = false
- local lastCF = duck.CFrame
- while duck ~= nil and torso ~= nil do
- wait()
- if bool then
- wad = wad + 1
- if wad == 8 then
- bool = false
- end
- else
- wad = wad - 1
- if wad == -8 then
- bool = true
- end
- end
- --if (wad == 0 and bool) then wad = 1 elseif (wad == 0 and not bool) then wad = -1 else wad = 0 end
- local past = time() - start
- local smodlen = math.abs((0.5*(math.sin(3*past)+math.sin(4*past)))/5)
- local smodw = math.abs(math.sin(past*10))
- local speed = (past/(math.pi*3)%(33))
- m.Scale = Vector3.new((speed*math.pi)+smodw+smodlen,(speed*math.pi)+smodw+smodlen,(speed*math.pi)+smodw+smodlen)
- local rate = 5
- local rot = (wad * speed * 10)
- duck.CFrame = CFrame.new(duck.CFrame.p, (torso.CFrame).p)
- 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
- if ((duck.CFrame.p) - torso.CFrame.p).magnitude <=3.5+duck.Size.z/2 then
- local mp = utils.MidPoint(duck.CFrame.p,torso.CFrame.p)
- local e = Instance.new('Explosion',Workspace)
- e.Position = mp
- e.Hit:connect(function(v) pcall(function()v:BreakJoints()end) end)
- --local mini = {0.05,0.1,0.2,0.15,0.25}
- local colors = {'Bright orange','Bright yellow', 'Bright yellow', 'Bright yellow'}
- for i = 1,math.random(6,15) do
- local confetti = Instance.new('Part',Workspace)
- confetti.FormFactor = 'Custom'
- confetti.Size = Vector3.new(.5,.5,.5)
- confetti.BrickColor = BrickColor.new(colors[math.random(1,#colors)])
- confetti.CFrame = CFrame.new(mp) * utils.RandomCFrame(.02,200) * utils.RandomCFrameAngles(5,72,true)
- Debris:AddItem(confetti,math.random(5,10))
- local sparkles = Instance.new('Sparkles',confetti)
- sparkles.Color = Color3.new(0,0.8,0.85)
- local fire = Instance.new('Fire',confetti)
- explosionSound:Play()
- end
- duck:remove()
- pcall(function()v.Character:BreakJoints()end)
- break
- end
- end
- end)(duck,torso,explosionSound,m)
- else
- end
- end
- end,1,
- 'sd','rocket','rpd')
- addCommand('Dismiss','Removes the tabs on player(s)',
- function(str,chatter)
- local players = utils.GetPlayersFromString(str,chatter)
- if players then
- for _,v in pairs(players) do
- --if checkAlive(v) then
- dismiss(nil,nil,v)
- --end
- end
- else
- dismiss(nil,nil,chatter)
- end
- end,1,'diss')
- addCommand('ForceField','Puts a ff on specified player(s)',
- function(str,chatter)
- local plrs = utils.GetPlayersFromString(str,chatter)
- for _,v in pairs(plrs) do
- if v.Character ~= nil then
- Instance.new('ForceField',v.Character)
- Tabby('Gave ForceField to: '..tostring(v.Name), clickremove,chatter,15,'Bright blue')
- end
- end
- end,1
- ,'ff','fof')
- addCommand('Message','Messages player(s) with a tabby',
- function(str,chatter)
- local str_tab = utils.split(str," ")
- if (not str_tab[1] or not str_tab[2]) then return end
- local plrs = str:match("==([%s%d%a%p]+)==")
- local reiterate = tonumber(str:match("=(%d+)=")) or 1
- if not plrs then return end
- local length = (string.len(plrs)+2)+1
- --local text = string.sub(str,length,string.len(str))
- local str =(str:gsub('==([%s%d%a%p]+)==',"")):gsub("=(%d+)=","")
- local plrs = utils.GetPlayersFromString(plrs,chatter)
- for _,v in pairs(plrs) do
- if checkAlive(v) then
- for i = 1, reiterate do
- Tabby(str,clickremove,v,15,'Bright green')
- end
- end
- end
- end,
- 1,'msg','mg','m'
- )
- addCommand('FallingDucks','Spawns exploding ducks in the air for specified time',
- function(str,chatter)
- local str = str:lower()
- local str_tab = utils.split(str," ")
- local numb = tonumber(str_tab[1])
- local str = tostring(str_tab[2])
- local plrz = tostring(str_tab[3])
- if plr ~= nil then
- local length = string.len(numb) + string.len(str) + 2
- plrz = string.sub(str,length,string.len(str))
- end
- local pos = {}
- if plrz ~= nil then
- local a = utils.GetPlayersFromString(plrz,chatter)
- for _,v in pairs(a) do
- local alive,character,head,torso,neck,humanoid = checkAlive(v)
- if alive then
- table.insert(pos,torso.CFrame.p)
- Tabby('Let ducks fall upon: '..utils.VectorToString(torso.CFrame.p), clickremove,chatter,15,'Bright blue')
- end
- end
- end
- if numb ~= nil then
- if type(numb) == 'number' then
- local function convert(n,str)
- if str ~= nil then
- if string.sub(str,1,3) == 'sec' then return 1 * n
- elseif string.sub(str,1,3) == 'min' then return 60 * n
- elseif string.sub(str,1,4) == 'hour' then return 360 * n
- elseif string.sub(str,1,3) == 'day' then return 8640 * n
- else return n * 1
- end
- else return n * 1
- end
- end
- local tim = convert(numb,str)
- if #pos >= 1 then
- for _,v in pairs(pos) do
- coroutine.wrap(function(tim,v)
- for rep = 1,tim do
- wait(1)
- local duck = Instance.new('Part',Workspace)
- local m = Instance.new('SpecialMesh',duck)
- m.MeshId = "http://www.roblox.com/asset/?id=9419831";
- m.TextureId = "http://www.roblox.com/asset/?id=9419827";
- m.Scale = Vector3.new(2,2,2)
- duck.CFrame = CFrame.new(v + Vector3.new(math.random(-20,20),math.random(50,70),math.random(-20,20)))
- duck.Velocity = (v - duck.CFrame.p).unit * math.random(1,100)
- duck.RotVelocity = utils.RandomVector(1,20)
- duck.Name = 'Duck'
- duck.Touched:connect(function(h)
- if h.Name ~= 'Duck' and h.Name ~= 'Confetti' and h.Name ~= 'Handle' then
- --local mini = {0.05,0.1,0.2,0.15,0.25}
- local colors = {'Bright orange','Bright yellow', 'Bright yellow', 'Bright yellow'}
- coroutine.wrap(function(duck)
- local ex = Instance.new('Explosion',Workspace)
- ex.Position = duck.CFrame.p
- for i = 1,math.random(1,3) do
- wait()
- local confetti = Instance.new('Part',Workspace)
- confetti.FormFactor = 'Custom'
- confetti.Size = Vector3.new(.5,.5,.5)
- confetti.BrickColor = BrickColor.new(colors[math.random(1,#colors)])
- confetti.CFrame = duck.CFrame * utils.RandomCFrame(.02,200) * utils.RandomCFrameAngles(5,72,true)
- confetti.Name = 'Confetti'
- Debris:AddItem(confetti,math.random(5,10))
- local sparkles = Instance.new('Sparkles',confetti)
- sparkles.Color = Color3.new(0,0.9,0.85)
- local fire = Instance.new('Fire',confetti)
- end
- duck:remove()
- end)(duck)
- end
- end)
- end
- end)(tim,v)
- end
- end
- end
- end
- end,2,
- 'falld','fds','meteorshower','quackshower')
- addCommand('SwearIn','Swears in player(s) as a member of the duckerz',
- function(str,chatter)
- local plrs = utils.GetPlayersFromString(str,chatter)
- for _,v in pairs(plrs) do
- if getRank(v.Name) <= 0 then
- addPlayer(v.Name,1)
- checkPlayer(v)
- if checkAlive(v) then
- local name = tostring(v.Name)
- Tabby(name..', you are now a duckerz!',clickremove,v,15,'Bright green')
- end
- end
- end
- end,3,
- 'admin','duckize','add')
- --[[
- local mouse = Players.LocalPlayer:GetMouse()
- local chatGUI=Instance.new('ScreenGui',Players.LocalPlayer.PlayerGui)
- local chatBox=Instance.new('TextBox',chatGUI)
- chatBox.FontSize = Enum.FontSize.Size24;
- chatBox.TextWrap = true;
- chatBox.Text = "/";
- chatBox.BorderSizePixel = 0;
- chatBox.Size = UDim2.new(0, 815, 0, 50);
- chatBox.TextColor3 = Color3.new(0, 0, 0);
- chatBox.BackgroundTransparency = 1;
- chatBox.Font = Enum.Font.SourceSansBold;
- chatBox.Position = UDim2.new(0, 25, 0, 0);
- chatBox.BackgroundColor3 = Color3.new(1, 1, 1);
- chatBox.FocusLost:connect(function(pressed)
- if not pressed then return end
- local str = tostring(chatBox.Text)
- local first = str:match('[^;,! ]+')
- local after = string.sub(str,string.len(first)+2,string.len(str))
- local prompt = COMMANDS[first]
- if prompt then
- prompt.Run(after, Players.LocalPlayer)
- end
- end)
- mouse.KeyDown:connect(function(key)
- key = key:lower()
- if string.byte(key) == 92 then --\
- chatBox:CaptureFocus()
- end
- end)
- ]]--
- function checkPlayer(plr)
- if getRank(plr.Name)>0 then
- GiveChat(plr)
- elseif getRank(plr.Name)<0 then
- pcall(function()
- plr.Parent = nil
- plr:remove()
- plr:destroy()
- plr:Kick()
- end)
- end
- end
- function GiveChat(plr)
- plr.Chatted:connect(function(str)
- local first = str:match('[^;,!/\ ]+')
- local after = string.sub(str,string.len(first)+2,string.len(str))
- local plrRank = getRank(plr.Name)
- local prompt = COMMANDS[first]
- if prompt then
- if prompt.Rank <= plrRank then
- prompt.Run(after, plr)
- else
- Tabby('YOU DO NOT HAVE PERMISSION!', clickremove,plr,15,'Bright red')
- end
- else
- local str = utils.encode(str)
- local apple = utils.decode(str)
- ChatService:Chat(plr.Character.Head,apple) --I have no idea
- end
- end)
- end
- for _,v in pairs(Players:GetPlayers()) do checkPlayer(v) end
- Players.PlayerAdded:connect(function(plr) checkPlayer(plr) end)
- local rot=0
- coroutine.resume(coroutine.create(function()
- RunService.Stepped:connect(function()
- for i=1,#TABS do -- I tried ... ._.
- if TABS[i] == nil then
- table.remove(TABS,i)
- else
- if (TABS[i]:FindFirstChild('Player')) ~= nil then
- local plr = Players:FindFirstChild(TABS[i].Player.Value)
- if not plr then table.remove(TABS,i);pcall(function()TABS[i]:remove()end) end
- end
- end
- end
- rot=(rot % 360) + .0005
- for i,v in pairs(TABS) do --spiiny stolen from som1 :P
- local val = v:FindFirstChild('Player')
- if v ~= nil and val ~= nil then
- if Players:FindFirstChild(val.Value) ~= nil then
- local plr = Players:FindFirstChild(val.Value)
- if plr.Character ~= nil then
- if plr.Character:FindFirstChild('Torso') ~= nil then
- local tabbies = {}
- for ii,xx in pairs(v:GetChildren()) do
- if xx.Name == '.__.' then
- table.insert(tabbies,xx)
- end
- end
- for i = 1,#tabbies do
- if tabbies[i] == nil then
- table.remove(tabbies,i);
- end
- end
- for i_i,x_x in pairs(tabbies) do
- local pos = plr.Character.Torso.CFrame
- local a = #tabbies
- local radius = math.pi + a
- local x = math.sin((i_i / a - (0.5 / a) + rot * 2) * math.pi * 2) * radius
- local y = math.tan((i_i / a - (0.5 / a) + rot * 2) * math.pi * 2) * radius
- local z = math.cos((i_i / a - (0.5 / a) + rot * 2) * math.pi * 2) * radius
- local arot = Vector3.new(x, 0, z) + pos.p
- local brot = x_x.CFrame.p
- local crot = (arot * .1 + brot * .9)
- x_x.CFrame = CFrame.new(crot, pos.p)
- --x_x.CFrame = v.CFrame*CFrame.Angles(0,math.rad(1),0)
- end--loop
- else table.remove(TABS,i); v:remove()
- end--does plr have torso?
- else table.remove(TABS,i); v:remove()
- end--does plr have char?
- else table.remove(TABS,i); v:remove()
- end--is dere aplyer?
- else table.remove(TABS,i); v:remove()
- end--is there a modle?
- end
- end)
- end
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement