SHOW:
|
|
- or go back to the newest paste.
| 1 | --[[ | |
| 2 | cmdscript.lua + safazi's edit | |
| 3 | written by safazi | |
| 4 | ||
| 5 | THE OFFICIAL MULTI ADMIN UPDATE: | |
| 6 | ADDCMD NOW TAKES TWO FUNCTION ARGUMENTS: | |
| 7 | ARGS | |
| 8 | ||
| 9 | and | |
| 10 | ||
| 11 | SPEAKER | |
| 12 | ||
| 13 | THE SPEAKER IS THE PLAYER OBJECT THAT SPOKE THE COMMAND | |
| 14 | WE HOPE THIS OPENS UP NEW OPPURTUNITIES FOR YOUR EDITS! | |
| 15 | ||
| 16 | -safazi | |
| 17 | ||
| 18 | HOW TO ADD COMMANDS | |
| 19 | Scroll to bottom, add after it says "Add commands here" | |
| 20 | ||
| 21 | PLEASE KEEP ALIASES LOWERCASE | |
| 22 | ||
| 23 | example with aliases: | |
| 24 | addcmd('command name','command description',{'alias for command','another alias'},
| |
| 25 | function(args,speaker) | |
| 26 | --code here | |
| 27 | end) | |
| 28 | ||
| 29 | example without aliases: | |
| 30 | addcmd('command name','command description',nil,
| |
| 31 | function(args,speaker) | |
| 32 | --code here | |
| 33 | end) | |
| 34 | ||
| 35 | important things: | |
| 36 | ||
| 37 | _char(playername) gets a players character from name if they exist | |
| 38 | example: | |
| 39 | - | local char=_char('safazi') --gets my character!
|
| 39 | + | local char=_char('TheOfficalNoob4788') --gets my character!
|
| 40 | ||
| 41 | command functions are passed the table "args", which holds the args after the command | |
| 42 | example: | |
| 43 | ;command arg1 arg2 arg3 arg4 | |
| 44 | --]] | |
| 45 | ||
| 46 | local gPlayers = game:GetService("Players")
| |
| 47 | local admin = gPlayers.LocalPlayer.Name | |
| 48 | local bannedplyrs = {}
| |
| 49 | ||
| 50 | - | local admins = {''} -- names here of people who have access to your commands! (Your name doesn't need to be in here.)
|
| 50 | + | local admins = {'TheOfficalNoob4788'} -- names here of people who have access to your commands! (Your name doesn't need to be in here.)
|
| 51 | ||
| 52 | -- declare services / init stuff -- | |
| 53 | local services={}
| |
| 54 | local cmds={}
| |
| 55 | local std={}
| |
| 56 | ||
| 57 | services.players=gPlayers | |
| 58 | services.lighting=game:GetService('Lighting')
| |
| 59 | services.workspace=game:GetService('Workspace')
| |
| 60 | services.events = {}
| |
| 61 | local user = gPlayers.LocalPlayer | |
| 62 | ||
| 63 | local cmdprefix=';' | |
| 64 | local scriptprefix='\\' | |
| 65 | local split=" " | |
| 66 | ||
| 67 | ||
| 68 | updateevents=function() | |
| 69 | for i,v in pairs(services.events) do services.events:remove(i) v:disconnect() end | |
| 70 | for i,v in pairs(gPlayers:players())do | |
| 71 | local ev = v.Chatted:connect(function(msg) do_exec(msg,v) end) | |
| 72 | services.events[#services.events+1] = ev | |
| 73 | end | |
| 74 | end | |
| 75 | ||
| 76 | -- safazi's lib -- | |
| 77 | ||
| 78 | std.inTable=function(tbl,val) | |
| 79 | if tbl==nil then return false end | |
| 80 | ||
| 81 | for _,v in pairs(tbl)do | |
| 82 | if v==val then return true end | |
| 83 | end | |
| 84 | return false | |
| 85 | end | |
| 86 | ||
| 87 | std.out=function(str) | |
| 88 | print(str) | |
| 89 | end | |
| 90 | ||
| 91 | std.list=function(tbl) --turns table into list with commas | |
| 92 | local str='' | |
| 93 | for i,v in pairs(tbl)do | |
| 94 | str=str..tostring(v) | |
| 95 | if i~=#tbl then str=str..', ' end | |
| 96 | end | |
| 97 | return str | |
| 98 | end | |
| 99 | ||
| 100 | std.endat=function(str,val) | |
| 101 | local z=str:find(val) | |
| 102 | if z then | |
| 103 | return str:sub(0,z-string.len(val)),true | |
| 104 | else | |
| 105 | return str,false | |
| 106 | end | |
| 107 | end | |
| 108 | ||
| 109 | std.first=function(str) return str:sub(1,1) end | |
| 110 | ||
| 111 | isAdmin=function(name) | |
| 112 | if name==admin then | |
| 113 | return true | |
| 114 | elseif admins[name]==true then | |
| 115 | return true | |
| 116 | end | |
| 117 | return false | |
| 118 | end | |
| 119 | ||
| 120 | gPlayers.PlayerAdded:connect(function(player) | |
| 121 | for i,v in pairs(bannedplyrs) do | |
| 122 | if player == v then player:Destroy() end | |
| 123 | end | |
| 124 | end) | |
| 125 | ||
| 126 | local exec=function(str) | |
| 127 | spawn(function() | |
| 128 | local script, loaderr = loadstring(str) | |
| 129 | if not script then | |
| 130 | error(loaderr) | |
| 131 | else | |
| 132 | script() | |
| 133 | end | |
| 134 | end) | |
| 135 | end | |
| 136 | ||
| 137 | local findCmd=function(cmd_name) | |
| 138 | for i,v in pairs(cmds)do | |
| 139 | if v.NAME:lower()==cmd_name:lower() or std.inTable(v.ALIAS,cmd_name:lower())then | |
| 140 | return v | |
| 141 | end | |
| 142 | end | |
| 143 | end | |
| 144 | ||
| 145 | local getCmd=function(msg) | |
| 146 | local cmd,hassplit=std.endat(msg:lower(),split) | |
| 147 | if hassplit then | |
| 148 | return {cmd,true}
| |
| 149 | else | |
| 150 | return {cmd,false}
| |
| 151 | end | |
| 152 | end | |
| 153 | ||
| 154 | local getprfx=function(strn) | |
| 155 | if strn:sub(1,string.len(cmdprefix))==cmdprefix then return{'cmd',string.len(cmdprefix)+1}
| |
| 156 | elseif strn:sub(1,string.len(scriptprefix))==scriptprefix then return{'exec',string.len(scriptprefix)+1}
| |
| 157 | end return | |
| 158 | end | |
| 159 | ||
| 160 | local getArgs=function(str) | |
| 161 | local args={}
| |
| 162 | local new_arg=nil | |
| 163 | local hassplit=nil | |
| 164 | local s=str | |
| 165 | repeat | |
| 166 | new_arg,hassplit=std.endat(s:lower(),split) | |
| 167 | if new_arg~='' then | |
| 168 | args[#args+1]=new_arg | |
| 169 | s=s:sub(string.len(new_arg)+string.len(split)+1) | |
| 170 | end | |
| 171 | until hassplit==false | |
| 172 | return args | |
| 173 | end | |
| 174 | ||
| 175 | local function execCmd(str, plr) | |
| 176 | local s_cmd | |
| 177 | local a | |
| 178 | local cmd | |
| 179 | s_cmd = getCmd(str) --separate command from string using split {command name,arg bool (for arg system)}
| |
| 180 | cmd = findCmd(s_cmd[1]) --get command object {NAME,DESC,{ALIASES},function(args)}
| |
| 181 | if cmd == nil then return end | |
| 182 | a = str:sub(string.len(s_cmd[1]) + string.len(split) + 1)--start string "a" after command and split | |
| 183 | local args=getArgs(a)--gets us a nice table of arguments | |
| 184 | ||
| 185 | pcall(function() | |
| 186 | cmd.FUNC(args, plr) | |
| 187 | end) | |
| 188 | end | |
| 189 | ||
| 190 | function do_exec(str,plr) | |
| 191 | if not isAdmin(plr.Name)then return end | |
| 192 | ||
| 193 | str=str:gsub('/e ','')--remove "/e " the easy way!
| |
| 194 | ||
| 195 | local t=getprfx(str) | |
| 196 | if t==nil then return end | |
| 197 | str=str:sub(t[2]) | |
| 198 | if t[1]=='exec' then | |
| 199 | exec(str) | |
| 200 | elseif t[1]=='cmd' then | |
| 201 | execCmd(str, plr) | |
| 202 | end | |
| 203 | end | |
| 204 | ||
| 205 | updateevents() | |
| 206 | --game.Players.LocalPlayer.Chatted:connect(doexec) | |
| 207 | ||
| 208 | local _char=function(plr_name) | |
| 209 | for i,v in pairs(game.Players:GetChildren())do | |
| 210 | if v:IsA'Player'then | |
| 211 | if v.Name==plr_name then return v.Character end | |
| 212 | end | |
| 213 | end | |
| 214 | return | |
| 215 | end | |
| 216 | ||
| 217 | local _plr=function(plr_name) | |
| 218 | for i,v in pairs(game.Players:GetChildren())do | |
| 219 | if v:IsA'Player'then | |
| 220 | if v.Name==plr_name then return v end | |
| 221 | end | |
| 222 | end | |
| 223 | return | |
| 224 | end | |
| 225 | ||
| 226 | function addcmd(name,desc,alias,func) | |
| 227 | cmds[#cmds+1]= | |
| 228 | {
| |
| 229 | NAME=name; | |
| 230 | DESC=desc; | |
| 231 | ALIAS=alias; | |
| 232 | FUNC=func; | |
| 233 | } | |
| 234 | end | |
| 235 | ||
| 236 | local function getPlayer(name) | |
| 237 | local nameTable = {}
| |
| 238 | name=name:lower() | |
| 239 | if name == "me" then | |
| 240 | return {admin}
| |
| 241 | elseif name == "others" then | |
| 242 | for i,v in pairs(gPlayers:GetChildren()) do | |
| 243 | if v:IsA'Player'then | |
| 244 | if v.Name~=admin then | |
| 245 | nameTable[#nameTable+1]=v.Name | |
| 246 | end | |
| 247 | end | |
| 248 | end | |
| 249 | elseif name == "all" then | |
| 250 | for i,v in pairs(gPlayers:GetChildren()) do | |
| 251 | if v:IsA'Player'then | |
| 252 | nameTable[#nameTable+1]=v.Name | |
| 253 | end | |
| 254 | end | |
| 255 | else | |
| 256 | for i,v in pairs(gPlayers:GetChildren()) do | |
| 257 | local lname = v.Name:lower() | |
| 258 | local i,j = lname:find(name) | |
| 259 | if i == 1 then | |
| 260 | return {v.Name}
| |
| 261 | end | |
| 262 | end | |
| 263 | end | |
| 264 | return nameTable | |
| 265 | end | |
| 266 | ||
| 267 | -- commands -- | |
| 268 | ||
| 269 | addcmd('ff',"ff's a player",{},
| |
| 270 | function(args) | |
| 271 | local players=getPlayer(args[1]) | |
| 272 | for i,v in pairs(players)do | |
| 273 | local pchar=_char(v) | |
| 274 | Instance.new("ForceField", pchar)
| |
| 275 | end | |
| 276 | end) | |
| 277 | ||
| 278 | addcmd('noff',"unff's a player",{'unff'},
| |
| 279 | function(args) | |
| 280 | local players=getPlayer(args[1]) | |
| 281 | for i,v in pairs(players)do | |
| 282 | local pchar=_char(v) | |
| 283 | for j,v1 in pairs(pchar:GetChildren()) do | |
| 284 | if v1:IsA("ForceField") then
| |
| 285 | v1:Destroy() | |
| 286 | end | |
| 287 | end | |
| 288 | end | |
| 289 | end) | |
| 290 | ||
| 291 | addcmd('smoke','give a player smoke',{},
| |
| 292 | function(args) | |
| 293 | local players=getPlayer(args[1]) | |
| 294 | for i,v in pairs(players)do | |
| 295 | local pchar=_char(v) | |
| 296 | Instance.new("Smoke", pchar.Torso)
| |
| 297 | end | |
| 298 | end) | |
| 299 | ||
| 300 | addcmd('nosmoke','remove smoke from a player',{},
| |
| 301 | function(args) | |
| 302 | local players=getPlayer(args[1]) | |
| 303 | for i,v in pairs(players)do | |
| 304 | local pchar=_char(v) | |
| 305 | for j,v1 in pairs(pchar.Torso:GetChildren()) do | |
| 306 | if v1:IsA("Smoke") then
| |
| 307 | v1:Destroy() | |
| 308 | end | |
| 309 | end | |
| 310 | end | |
| 311 | end) | |
| 312 | ||
| 313 | addcmd('btools','gives a player btools',{},
| |
| 314 | function(args) | |
| 315 | local players=getPlayer(args[1]) | |
| 316 | if players ~= nil then | |
| 317 | for i, v in pairs(players) do | |
| 318 | Instance.new("HopperBin", gPlayers[v].Backpack).BinType = 2
| |
| 319 | Instance.new("HopperBin", gPlayers[v].Backpack).BinType = 3
| |
| 320 | Instance.new("HopperBin", gPlayers[v].Backpack).BinType = 4
| |
| 321 | end | |
| 322 | end | |
| 323 | end) | |
| 324 | ||
| 325 | addcmd('god','gods player',{},
| |
| 326 | function(args) | |
| 327 | local players=getPlayer(args[1]) | |
| 328 | for i,v in pairs(players)do | |
| 329 | local pchar=_char(v) | |
| 330 | if pchar then pchar.Humanoid.MaxHealth=math.huge end | |
| 331 | end | |
| 332 | end) | |
| 333 | ||
| 334 | addcmd('sgod','silently gods player',{},
| |
| 335 | function(args) | |
| 336 | local players=getPlayer(args[1]) | |
| 337 | for i,v in pairs(players)do | |
| 338 | local pchar=_char(v) | |
| 339 | spawn(function() | |
| 340 | pchar.Humanoid.MaxHealth = 10000000 | |
| 341 | wait() | |
| 342 | pchar.Humanoid.Health = 10000000 | |
| 343 | end) | |
| 344 | end | |
| 345 | end) | |
| 346 | ||
| 347 | addcmd('ungod','removes god from a player',{},
| |
| 348 | function(args) | |
| 349 | local players=getPlayer(args[1]) | |
| 350 | for i,v in pairs(players)do | |
| 351 | local pchar=_char(v) | |
| 352 | if pchar then | |
| 353 | pchar.Humanoid.MaxHealth=100 | |
| 354 | pchar.Humanoid.Health=100 | |
| 355 | end | |
| 356 | end | |
| 357 | end) | |
| 358 | ||
| 359 | addcmd('heal','resets a players health',{},
| |
| 360 | function(args) | |
| 361 | local players=getPlayer(args[1]) | |
| 362 | for i,v in pairs(players)do | |
| 363 | local pchar=_char(v) | |
| 364 | if pchar then pchar.Humanoid.Health=pchar.Humanoid.MaxHealth;end | |
| 365 | end | |
| 366 | end) | |
| 367 | ||
| 368 | addcmd('frz','freezes a player',{},
| |
| 369 | function(args) | |
| 370 | local players = getPlayer(args[1]) | |
| 371 | if players ~= nil then | |
| 372 | for i, v in pairs(players) do | |
| 373 | _char(v).Torso.Anchored = true | |
| 374 | end | |
| 375 | end | |
| 376 | end) | |
| 377 | ||
| 378 | addcmd('thaw','freezes a player',{},
| |
| 379 | function(args) | |
| 380 | local players = getPlayer(args[1]) | |
| 381 | if players ~= nil then | |
| 382 | for i, v in pairs(players) do | |
| 383 | _char(v).Torso.Anchored = false | |
| 384 | end | |
| 385 | end | |
| 386 | end) | |
| 387 | ||
| 388 | addcmd('kill','kills a player',{},
| |
| 389 | function(args) | |
| 390 | local players=getPlayer(args[1]) | |
| 391 | for i,v in pairs(players)do | |
| 392 | local pchar=_char(v) | |
| 393 | if pchar then pchar.Humanoid.MaxHealth=0;pchar.Humanoid.Health=0;end | |
| 394 | end | |
| 395 | end) | |
| 396 | ||
| 397 | addcmd('sound','plays a sound',{},
| |
| 398 | function(args) | |
| 399 | local function dels(instance) | |
| 400 | for i,v in pairs(instance:GetChildren())do | |
| 401 | if v:IsA'Sound'then v:Destroy()end | |
| 402 | dels(v) | |
| 403 | end | |
| 404 | end | |
| 405 | dels(workspace) | |
| 406 | ||
| 407 | local c=args[1]or'stop' | |
| 408 | if std.inTable({'stop'},c:lower())then return end
| |
| 409 | local s=Instance.new("Sound", workspace)
| |
| 410 | s.Looped = true | |
| 411 | s.SoundId = "rbxassetid://"..c | |
| 412 | s.Volume=1 | |
| 413 | s:Play() | |
| 414 | end) | |
| 415 | ||
| 416 | addcmd('explode','explode a player', {},
| |
| 417 | function(args) | |
| 418 | local players=getPlayer(args[1]) | |
| 419 | for i, v in pairs(players) do | |
| 420 | local char = _char(v) | |
| 421 | if char:FindFirstChild("Torso") then
| |
| 422 | Instance.new("Explosion", char).Position = char.Torso.Position
| |
| 423 | end | |
| 424 | end | |
| 425 | end) | |
| 426 | ||
| 427 | addcmd('invis','make a player invisible',{},
| |
| 428 | function(args) | |
| 429 | local players=getPlayer(args[1]) | |
| 430 | for i, v in pairs(players) do | |
| 431 | for k, v2 in pairs(_char(v):GetChildren()) do | |
| 432 | if v2.className == "Part" then | |
| 433 | if v2.Name ~= "HumanoidRootPart" then v2.Transparency = 1 end | |
| 434 | elseif v2.className == "Hat" then | |
| 435 | if v2:FindFirstChild("Handle") then
| |
| 436 | v2.Handle.Transparency = 1 | |
| 437 | end | |
| 438 | end | |
| 439 | if v2:FindFirstChild("face") then
| |
| 440 | v2.face:Destroy() | |
| 441 | end | |
| 442 | end | |
| 443 | end | |
| 444 | end) | |
| 445 | ||
| 446 | addcmd('vis','make a player visible',{},
| |
| 447 | function(args) | |
| 448 | local players=getPlayer(args[1]) | |
| 449 | for i, v in pairs(players) do | |
| 450 | for k, v2 in pairs(_char(v):GetChildren()) do | |
| 451 | if v2.className == "Part" then | |
| 452 | if v2.Name ~= "HumanoidRootPart" then v2.Transparency = 0 end | |
| 453 | elseif v2.className == "Hat" then | |
| 454 | if v2:FindFirstChild("Handle") then v2.Handle.Transparency = 0 end
| |
| 455 | end | |
| 456 | if v2:FindFirstChild("face") then
| |
| 457 | v2.face:Destroy() | |
| 458 | end | |
| 459 | end | |
| 460 | end | |
| 461 | end) | |
| 462 | ||
| 463 | addcmd('goto','go to a player',{},
| |
| 464 | function(args) | |
| 465 | local players=getPlayer(args[1]) | |
| 466 | if players ~= nil and _char(players[1]):FindFirstChild("HumanoidRootPart") then
| |
| 467 | _char(admin).HumanoidRootPart.CFrame = _char(players[1]).HumanoidRootPart.CFrame | |
| 468 | end | |
| 469 | end) | |
| 470 | ||
| 471 | addcmd('bring','bring a player to you',{},
| |
| 472 | function(args) | |
| 473 | local players=getPlayer(args[1]) | |
| 474 | for i,v in pairs(players) do | |
| 475 | if _char(v):FindFirstChild("HumanoidRootPart") then
| |
| 476 | _char(v).HumanoidRootPart.CFrame = _char(admin).HumanoidRootPart.CFrame | |
| 477 | end | |
| 478 | end | |
| 479 | end) | |
| 480 | ||
| 481 | addcmd('tp','teleport player 1 to player 2',{},
| |
| 482 | function(args) | |
| 483 | local players1=getPlayer(args[1]) | |
| 484 | local players2=getPlayer(args[2]) | |
| 485 | if not players2[1] then return end | |
| 486 | for i,v in pairs(players1) do | |
| 487 | if _char(v):FindFirstChild("HumanoidRootPart") and _char(players2[1]):FindFirstChild("HumanoidRootPart") then
| |
| 488 | _char(v).HumanoidRootPart.CFrame = _char(players2[1]).HumanoidRootPart.CFrame | |
| 489 | end | |
| 490 | end | |
| 491 | end) | |
| 492 | ||
| 493 | addcmd('charapp','change a players appearance',{},
| |
| 494 | function(args) | |
| 495 | local players=getPlayer(args[1]) | |
| 496 | if not args[1]or not args[2]then return end | |
| 497 | local id=args[2] | |
| 498 | if players ~= nil then | |
| 499 | for i,v in pairs(players) do | |
| 500 | gPlayers[v].CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId="..id | |
| 501 | if _char(v):FindFirstChild("Head") then
| |
| 502 | _char(v).Head:Destroy() | |
| 503 | end | |
| 504 | end | |
| 505 | end | |
| 506 | end) | |
| 507 | ||
| 508 | addcmd('ws','change a players walkspeed',{},
| |
| 509 | function(args) | |
| 510 | local players=getPlayer(args[1]) | |
| 511 | if not args[1]or not args[2]then return end | |
| 512 | local num=args[2] | |
| 513 | for i,v in pairs(players) do | |
| 514 | if _char(v):FindFirstChild("Humanoid") then
| |
| 515 | _char(v).Humanoid.WalkSpeed=tonumber(num) | |
| 516 | end | |
| 517 | end | |
| 518 | end) | |
| 519 | ||
| 520 | addcmd('time','change the time of day',{},
| |
| 521 | function(args) | |
| 522 | if not args[1]then return end | |
| 523 | local time_=tonumber(args[1]) | |
| 524 | ||
| 525 | game.Lighting:SetMinutesAfterMidnight(time_*60) | |
| 526 | end) | |
| 527 | ||
| 528 | addcmd('kick','kick a player',{},
| |
| 529 | function(args) | |
| 530 | local players=getPlayer(args[1]) | |
| 531 | for i,v in pairs(players) do | |
| 532 | gPlayers[v]:Destroy() | |
| 533 | end | |
| 534 | end) | |
| 535 | ||
| 536 | addcmd('ban','ban a player',{},
| |
| 537 | function(args) | |
| 538 | local players=getPlayer(args[1]) | |
| 539 | for i,v in pairs(players) do | |
| 540 | bannedplyrs[#bannedplyrs+1]=v | |
| 541 | gPlayers[v]:Destroy() | |
| 542 | end | |
| 543 | end) | |
| 544 | ||
| 545 | addcmd('unlockws','unlock the whole workspace',{},
| |
| 546 | function(args) | |
| 547 | local function unlock(instance) | |
| 548 | for i,v in pairs(instance:GetChildren()) do | |
| 549 | if v:IsA("BasePart") then
| |
| 550 | v.Locked = false | |
| 551 | end | |
| 552 | unlock(v) | |
| 553 | end | |
| 554 | end | |
| 555 | unlock(workspace) | |
| 556 | end) | |
| 557 | ||
| 558 | addcmd('unanchorws','unanchor the whole workspace',{},
| |
| 559 | function(args) | |
| 560 | local function unanchor(instance) | |
| 561 | for i,v in pairs(instance:GetChildren()) do | |
| 562 | if v:IsA("BasePart") then
| |
| 563 | v.Anchored=false | |
| 564 | end | |
| 565 | unanchor(v) | |
| 566 | end | |
| 567 | end | |
| 568 | unanchor(workspace) | |
| 569 | end) | |
| 570 | ||
| 571 | addcmd('hat','give player a hat ingame',{},
| |
| 572 | function(args) | |
| 573 | if not args[1] or not args[2] then return end | |
| 574 | local players=getPlayer(args[1]) | |
| 575 | local id=args[2] | |
| 576 | local hat = game:GetObjects("rbxassetid://"..id)[1]
| |
| 577 | if hat:IsA("Hat") then
| |
| 578 | for i,v in pairs(players) do | |
| 579 | hat:clone().Parent = _char(v) | |
| 580 | end | |
| 581 | end | |
| 582 | hat:Destroy() | |
| 583 | end) | |
| 584 | ||
| 585 | addcmd('gear','give player a gear ingame',{},
| |
| 586 | function(args) | |
| 587 | spawn(function() | |
| 588 | if not args[1] or not args[2] then return end | |
| 589 | local players=getPlayer(args[1]) | |
| 590 | local id=args[2] | |
| 591 | local model = game:GetService("InsertService"):LoadAsset(id)
| |
| 592 | for i,v in pairs(players) do | |
| 593 | for _,j in pairs(model:GetChildren()) do | |
| 594 | if j:IsA("Tool") then
| |
| 595 | j:Clone().Parent = gPlayers[v].Backpack | |
| 596 | end | |
| 597 | end | |
| 598 | end | |
| 599 | model:Destroy() | |
| 600 | end) | |
| 601 | end) | |
| 602 | ||
| 603 | addcmd('pstools','give player personal server tools',{},
| |
| 604 | function(args) | |
| 605 | local players=getPlayer(args[1]) | |
| 606 | for i,v in pairs(players) do | |
| 607 | gPlayers[v].PersonalServerRank = 240 | |
| 608 | end | |
| 609 | end) | |
| 610 | ||
| 611 | addcmd('skick','kicks a player by shutting them down, takes a few seconds',{},
| |
| 612 | function(args) | |
| 613 | local players=getPlayer(args[1]) | |
| 614 | for i,v in pairs(players) do | |
| 615 | spawn(function() | |
| 616 | gPlayers[v].PersonalServerRank = 240 | |
| 617 | gPlayers[v].Backpack:WaitForChild("ClassicTool")
| |
| 618 | gPlayers[v].PersonalServerRank = 0 | |
| 619 | end) | |
| 620 | end | |
| 621 | end) | |
| 622 | ||
| 623 | addcmd('admin','gives a player admin',{},
| |
| 624 | function(args) | |
| 625 | if not args[1]then return end | |
| 626 | local players=getPlayer(args[1]) | |
| 627 | table.foreach(players,function(k,v) | |
| 628 | admins[v]=true | |
| 629 | end) | |
| 630 | end) | |
| 631 | ||
| 632 | addcmd('unadmin','removes a players admin',{},
| |
| 633 | function(args) | |
| 634 | if not args[1] then return end | |
| 635 | local players=getPlayer(args[1]) | |
| 636 | table.foreach(players,function(k,v) | |
| 637 | admins[v]=nil | |
| 638 | end) | |
| 639 | end) | |
| 640 | ||
| 641 | addcmd('dark','makes the game dark',{'drk'},
| |
| 642 | function() | |
| 643 | game.Lighting.TimeOfDay="21:00:00" | |
| 644 | game.Lighting.FogColor=Color3.new(0,0,0) | |
| 645 | game.Lighting.Ambient=Color3.new(0,0,0) | |
| 646 | game.Lighting.ShadowColor=Color3.new(0,0,0) | |
| 647 | game.Lighting.OutdoorAmbient=Color3.new(0,0,0) | |
| 648 | end) | |
| 649 | ||
| 650 | addcmd('reverse','reverse the players controls',{},
| |
| 651 | function(args) | |
| 652 | local players=getPlayer(args[1]) | |
| 653 | for i,v in pairs(players) do | |
| 654 | gPlayers[v].Character.Humanoid.WalkSpeed=tonumber(-16) | |
| 655 | end | |
| 656 | end) | |
| 657 | ||
| 658 | addcmd('creeper','make the player a creeper',{'crpr'},
| |
| 659 | function(args) | |
| 660 | local players=getPlayer(args[1]) | |
| 661 | for i,v in pairs(players)do | |
| 662 | if gPlayers[v] and gPlayers[v].Character and gPlayers[v].Character:findFirstChild("Torso") then
| |
| 663 | if gPlayers[v].Character:findFirstChild("Shirt") then gPlayers[v].Character.Shirt.Parent = gPlayers[v].Character.Torso end
| |
| 664 | if gPlayers[v].Character:findFirstChild("Pants") then gPlayers[v].Character.Pants.Parent = gPlayers[v].Character.Torso end
| |
| 665 | gPlayers[v].Character.Torso.Transparency = 0 | |
| 666 | gPlayers[v].Character.Torso.Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(90),math.rad(180),0) | |
| 667 | gPlayers[v].Character.Torso["Right Shoulder"].C0 = CFrame.new(0,-1.5,-.5) * CFrame.Angles(0,math.rad(90),0) | |
| 668 | gPlayers[v].Character.Torso["Left Shoulder"].C0 = CFrame.new(0,-1.5,-.5) * CFrame.Angles(0,math.rad(-90),0) | |
| 669 | gPlayers[v].Character.Torso["Right Hip"].C0 = CFrame.new(0,-1,.5) * CFrame.Angles(0,math.rad(90),0) | |
| 670 | gPlayers[v].Character.Torso["Left Hip"].C0 = CFrame.new(0,-1,.5) * CFrame.Angles(0,math.rad(-90),0) | |
| 671 | end | |
| 672 | end | |
| 673 | end) | |
| 674 | ||
| 675 | addcmd('derp','make the player derp',{},
| |
| 676 | function(args) | |
| 677 | local players=getPlayer(args[1]) | |
| 678 | for i,v in pairs(players)do | |
| 679 | for _,x in pairs(gPlayers[v].Character.Torso:GetChildren()) do | |
| 680 | if x:IsA("Motor6D") then x.DesiredAngle=6 x.CurrentAngle=04340.000305 x.MaxVelocity=10.100000 end
| |
| 681 | end | |
| 682 | end | |
| 683 | end) | |
| 684 | ||
| 685 | addcmd('noderp','make the player normal',{},
| |
| 686 | function(args) | |
| 687 | local players=getPlayer(args[1]) | |
| 688 | for i,v in pairs(players)do | |
| 689 | for _,x in pairs(gPlayers[v].Character.Torso:GetChildren()) do | |
| 690 | if x:IsA("Motor6D") then x.DesiredAngle=0 x.CurrentAngle=0.003809 x.MaxVelocity=0.100000 end
| |
| 691 | end | |
| 692 | end | |
| 693 | end) | |
| 694 | ||
| 695 | addcmd('nuke','nuke a player', {},
| |
| 696 | function(args) | |
| 697 | local players=getPlayer(args[1]) | |
| 698 | for i, v in pairs(players) do | |
| 699 | local char = _char(v) | |
| 700 | if char:FindFirstChild("Torso") then
| |
| 701 | if not args[2] then args[2]=20*4 end | |
| 702 | for i=1,args[2]*4 do | |
| 703 | Instance.new("Explosion", char).Position = char.Torso.Position
| |
| 704 | end | |
| 705 | end | |
| 706 | end | |
| 707 | end) | |
| 708 | ||
| 709 | addcmd('paper','makes the player thin as paper',{},
| |
| 710 | function(args) | |
| 711 | local players=getPlayer(args[1]) | |
| 712 | for i,v in pairs(players)do | |
| 713 | for _,x in pairs(gPlayers[v].Character:GetChildren()) do | |
| 714 | if x:IsA("BasePart") then
| |
| 715 | t=Instance.new("SpecialMesh",x)
| |
| 716 | t.MeshType=6 | |
| 717 | t.Scale=Vector3.new(1,1,0.1) | |
| 718 | elseif x:IsA("Hat") then
| |
| 719 | t=Instance.new("SpecialMesh",x.Handle)
| |
| 720 | t.MeshType=6 | |
| 721 | t.Name='secrt' | |
| 722 | t.Scale=Vector3.new(1,1,.005) | |
| 723 | t.MeshId=x.Handle.Mesh.MeshId | |
| 724 | t.TextureId=x.Handle.Mesh.TextureId | |
| 725 | elseif x:IsA("Tool") or x:IsA("HopperBin") then
| |
| 726 | t=Instance.new("SpecialMesh",x.Handle)
| |
| 727 | t.MeshType=6 | |
| 728 | t.Name='secrt' | |
| 729 | t.Scale=Vector3.new(.005,x.Handle.Mesh.Scale.y,x.Handle.Mesh.Scale.z) | |
| 730 | t.MeshId=x.Handle.Mesh.MeshId | |
| 731 | t.TextureId=x.Handle.Mesh.TextureId | |
| 732 | end | |
| 733 | end | |
| 734 | end | |
| 735 | end) | |
| 736 | ||
| 737 | addcmd('animation','set custom anim',{'anim'},
| |
| 738 | function(args) | |
| 739 | local players=getPlayer(args[1]) | |
| 740 | for i,v in pairs(players)do | |
| 741 | t=args[2] | |
| 742 | if args[2]=="climb" then t="180436334" end | |
| 743 | if args[2]=="sit" then t="178130996" end | |
| 744 | if args[2]=="jump" then t="125750702" end | |
| 745 | if args[2]=="fall" then t="180436148" end | |
| 746 | for _,x in pairs(gPlayers[v].Character.Animate:GetChildren()) do | |
| 747 | if x:IsA("StringValue") then
| |
| 748 | for _,c in pairs(x:GetChildren()) do if c:IsA("Animation") then c.AnimationId="rbxassetid://"..t end end
| |
| 749 | end | |
| 750 | end | |
| 751 | end | |
| 752 | end) | |
| 753 | ||
| 754 | addcmd('ghost','makes the player a ghost',{},
| |
| 755 | function(args) | |
| 756 | local players=getPlayer(args[1]) | |
| 757 | for i,v in pairs(players)do | |
| 758 | for _,x in pairs(gPlayers[v].Character:GetChildren()) do | |
| 759 | if x:IsA("BasePart") and x.Name=="HumanoidRootPart" then
| |
| 760 | x.Transparency=1 | |
| 761 | else | |
| 762 | x.Transparency=0.5 | |
| 763 | end | |
| 764 | end | |
| 765 | end | |
| 766 | end) | |
| 767 | ||
| 768 | addcmd('noghost','makes the player a human',{},
| |
| 769 | function(args) | |
| 770 | local players=getPlayer(args[1]) | |
| 771 | for i,v in pairs(players)do | |
| 772 | for _,x in pairs(gPlayers[v].Character:GetChildren()) do | |
| 773 | if x:IsA("BasePart") then
| |
| 774 | x.Transparency=0 | |
| 775 | elseif x:IsA("BasePart") and x.Name=="HumanoidRootPart" then
| |
| 776 | x.Transparency=1 | |
| 777 | end | |
| 778 | end | |
| 779 | end | |
| 780 | end) | |
| 781 | ||
| 782 | addcmd('playeresp','takes you right to the players.',{'esp'},
| |
| 783 | function(args) | |
| 784 | local players=getPlayer(args[1]) | |
| 785 | for i,v in pairs(players)do | |
| 786 | for i,v in pairs(game.Workspace:children()) do | |
| 787 | if v:isA("SelectionPartLasso") then
| |
| 788 | v:Destroy() | |
| 789 | end | |
| 790 | end | |
| 791 | for i, v in pairs(players) do | |
| 792 | local las = Instance.new("SelectionPartLasso",game.Workspace)
| |
| 793 | las.Color = BrickColor.new("1019")
| |
| 794 | las.Humanoid = game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
| |
| 795 | las.Part = gPlayers[v].Character:findFirstChild("Torso")
| |
| 796 | end | |
| 797 | end | |
| 798 | end) | |
| 799 | ||
| 800 | addcmd('bomb','spawns a bomb(s) above your head',{},
| |
| 801 | function(args) | |
| 802 | local players=getPlayer(args[1]) | |
| 803 | for i,v in pairs(players) do | |
| 804 | for i=1,args[2] do | |
| 805 | function bomb() | |
| 806 | x=game.Players.LocalPlayer.Character.Head | |
| 807 | local bomb2 = Instance.new("Part",game.Workspace)
| |
| 808 | ||
| 809 | bomb2.Position = gPlayers[v].Character.Head.Position | |
| 810 | bomb2.Size = Vector3.new(2,2,2) | |
| 811 | ||
| 812 | bomb2.BrickColor = BrickColor.new(21) | |
| 813 | bomb2.Shape = 0 | |
| 814 | bomb2.BottomSurface = 0 | |
| 815 | bomb2.TopSurface = 0 | |
| 816 | bomb2.Reflectance = 1 | |
| 817 | bomb2.Locked = true | |
| 818 | wait(3) | |
| 819 | explosion = Instance.new("Explosion")
| |
| 820 | explosion.BlastRadius = 12 | |
| 821 | explosion.BlastPressure = 1000000 -- these are really wussy units | |
| 822 | ||
| 823 | explosion.Position = bomb2.Position | |
| 824 | explosion.Parent = game.Workspace | |
| 825 | bomb2:Remove(); | |
| 826 | end | |
| 827 | spawn(bomb) | |
| 828 | end | |
| 829 | end | |
| 830 | end) | |
| 831 | ||
| 832 | addcmd('glow','gives the player a glow',{'glw'},
| |
| 833 | function(args) | |
| 834 | local players = getPlayer(args[1]) | |
| 835 | if players ~= nil then | |
| 836 | for i, v in pairs(players) do | |
| 837 | local r=args[2] | |
| 838 | local g=args[3] | |
| 839 | local b=args[4] | |
| 840 | if args[2]=="pink" then r="255" g="0" b="255" end | |
| 841 | if args[2]=="blue" then r="0" g="0" b="255" end | |
| 842 | if args[2]=="red" then r="255" g="0" b="0" end | |
| 843 | if args[2]=="white" then r="255" g="255" b="255" end | |
| 844 | if args[2]=="purple" then r="137"/255 g="24"/255 b="236"/255 end | |
| 845 | if args[2]=="green" then r="0" g="255" b="0" end | |
| 846 | if args[2]=="yellow" then r="255" g="255" b="0" end | |
| 847 | if args[2]=="orange" then r="236"/255 g="83"/255 b="22"/255 end | |
| 848 | if not args[5] or args[6] then args[5]=60 args[6]=1000000 end | |
| 849 | local x=Instance.new("PointLight", gPlayers[v].Character.Torso)
| |
| 850 | x.Range=args[5] | |
| 851 | x.Color=Color3.new(r,g,b) | |
| 852 | x.Brightness=args[6] | |
| 853 | end | |
| 854 | end | |
| 855 | end) | |
| 856 | ||
| 857 | addcmd('noglow','removes the players glow',{'nog'},
| |
| 858 | function(args) | |
| 859 | local players = getPlayer(args[1]) | |
| 860 | if players ~= nil then | |
| 861 | for i, v in pairs(players) do | |
| 862 | for j,v1 in pairs(gPlayers[v].Character.Torso:GetChildren()) do | |
| 863 | if v1:IsA("PointLight") then
| |
| 864 | v1:Destroy(); | |
| 865 | end | |
| 866 | end | |
| 867 | end | |
| 868 | end | |
| 869 | end) | |
| 870 | ||
| 871 | addcmd('headlight','gives the player a headlight',{'hl'},
| |
| 872 | function(args) | |
| 873 | local players = getPlayer(args[1]) | |
| 874 | if players ~= nil then | |
| 875 | for i, v in pairs(players) do | |
| 876 | local r=args[2] | |
| 877 | local g=args[3] | |
| 878 | local b=args[4] | |
| 879 | if args[2]=="pink" then r="255" g="0" b="255" end | |
| 880 | if args[2]=="blue" then r="0" g="0" b="255" end | |
| 881 | if args[2]=="red" then r="255" g="0" b="0" end | |
| 882 | if args[2]=="white" then r="255" g="255" b="255" end | |
| 883 | if args[2]=="purple" then r="137"/255 g="24"/255 b="236"/255 end | |
| 884 | if args[2]=="green" then r="0" g="255" b="0" end | |
| 885 | if args[2]=="yellow" then r="255" g="255" b="0" end | |
| 886 | if args[2]=="orange" then r="236"/255 g="83"/255 b="22"/255 end | |
| 887 | local x=Instance.new("SpotLight", gPlayers[v].Character.Head)
| |
| 888 | x.Range=5665656 | |
| 889 | x.Angle=50 | |
| 890 | x.Color=Color3.new(r,g,b) | |
| 891 | x.Brightness=34242342342 | |
| 892 | end | |
| 893 | end | |
| 894 | end) | |
| 895 | ||
| 896 | addcmd('noheadlight','removes the players headlight',{'nohl'},
| |
| 897 | function(args) | |
| 898 | local players = getPlayer(args[1]) | |
| 899 | if players ~= nil then |