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