daily pastebin goal
42%
SHARE
TWEET

PrivateLua

a guest Jan 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   local gPlayers = game:GetService("Players")
  2.     local admin = gPlayers.LocalPlayer.Name
  3.     local bannedplyrs = {'PeopleYouHate','MorePeopleYouHate'}
  4.    
  5.     local admins = {'Friend, Friend'} -- names here of people who have access to your commands! (Your name doesn't need to be in here.)
  6.    
  7.     -- declare services / init stuff --
  8.    
  9.     local services={}
  10.     local cmds={}
  11.     local std={}
  12.    
  13.     local serverLocked = false
  14.    
  15.     function FIX_LIGHTING()
  16.     game.Lighting.Ambient = Color3.new(0.5, 0.5, 0.5)
  17.     game.Lighting.Brightness = 1
  18.     game.Lighting.GlobalShadows = true
  19.     game.Lighting.Outlines = false
  20.     game.Lighting.TimeOfDay = 14
  21.     game.Lighting.FogEnd = 100000
  22.     end
  23.    
  24.     services.players=gPlayers
  25.     services.lighting=game:GetService('Lighting')
  26.     services.workspace=game:GetService('Workspace')
  27.     services.events = {}
  28.     local user = gPlayers.LocalPlayer
  29.    
  30.     local cmdprefix    = ''
  31.     local scriptprefix = '/'
  32.     local split        = " "
  33.    
  34.    
  35.     updateevents=function()
  36.     for i,v in pairs(services.events) do services.events:remove(i) v:disconnect() end
  37.     for i,v in pairs(gPlayers:players())do
  38.     local ev = v.Chatted:connect(function(msg) do_exec(msg,v) end)
  39.     services.events[#services.events+1] = ev
  40.     end
  41.     end
  42.    
  43.     std.inTable=function(tbl,val)
  44.     if tbl==nil then return false end
  45.    
  46.     for _,v in pairs(tbl)do
  47.     if v==val then return true end
  48.     end
  49.     return false
  50.     end
  51.    
  52.     std.out=function(str)
  53.     print(str)
  54.     end
  55.    
  56.     std.list=function(tbl) --turns table into list with commas
  57.     local str=''
  58.     for i,v in pairs(tbl)do
  59.     str=str..tostring(v)
  60.     if i~=#tbl then str=str..', ' end
  61.     end
  62.     return str
  63.     end
  64.    
  65.     std.endat=function(str,val)
  66.     local z=str:find(val)
  67.     if z then
  68.     return str:sub(0,z-string.len(val)),true
  69.     else
  70.     return str,false
  71.     end
  72.     end
  73.    
  74.     std.first=function(str) return str:sub(1,1) end
  75.    
  76.     isAdmin=function(name)
  77.     if name==admin then
  78.     return true
  79.     elseif admins[name]==true then
  80.     return true
  81.     end
  82.     return false
  83.     end
  84.    
  85.     gPlayers.PlayerAdded:connect(function(player)
  86.     for i,v in pairs(bannedplyrs) do
  87.     game.ReplicatedStorage.Event:FireServer("TPD", 2000, gPlayers[v].Character.Humanoid)
  88.     end
  89.     end)
  90.    
  91.     local exec=function(str)
  92.     spawn(function()
  93.     local script, loaderr = loadstring(str)
  94.     if not script then
  95.     error(loaderr)
  96.     else
  97.     script()
  98.     end
  99.     end)
  100.     end
  101.    
  102.     local findCmd=function(cmd_name)
  103.     for i,v in pairs(cmds)do
  104.     if v.NAME:lower()==cmd_name:lower() or std.inTable(v.ALIAS,cmd_name:lower())then
  105.     return v
  106.     end
  107.     end
  108.     end
  109.    
  110.     local getCmd=function(msg)
  111.     local cmd,hassplit=std.endat(msg:lower(),split)
  112.     if hassplit then
  113.     return {cmd,true}
  114.     else
  115.     return {cmd,false}
  116.     end
  117.     end
  118.    
  119.     local getprfx=function(strn)
  120.     if strn:sub(1,string.len(cmdprefix))==cmdprefix then return{'cmd',string.len(cmdprefix)+1}
  121.     elseif strn:sub(1,string.len(scriptprefix))==scriptprefix then return{'exec',string.len(scriptprefix)+1}
  122.     end return
  123.     end
  124.    
  125.     local getArgs=function(str)
  126.     local args={}
  127.     local new_arg=nil
  128.     local hassplit=nil
  129.     local s=str
  130.     repeat
  131.     new_arg,hassplit=std.endat(s:lower(),split)
  132.     if new_arg~='' then
  133.     args[#args+1]=new_arg
  134.     s=s:sub(string.len(new_arg)+string.len(split)+1)
  135.     end
  136.     until hassplit==false
  137.     return args
  138.     end
  139.    
  140.     local function execCmd(str, plr)
  141.     local s_cmd
  142.     local a
  143.     local cmd
  144.     s_cmd = getCmd(str) --separate command from string using split {command name,arg bool (for arg system)}
  145.     cmd = findCmd(s_cmd[1]) --get command object {NAME,DESC,{ALIASES},function(args)}
  146.     if cmd == nil then return end
  147.     a = str:sub(string.len(s_cmd[1]) + string.len(split) + 1)--start string "a" after command and split
  148.     local args=getArgs(a)--gets us a nice table of arguments
  149.    
  150.     pcall(function()
  151.     cmd.FUNC(args, plr)
  152.     end)
  153.     end
  154.    
  155.     function do_exec(str,plr)
  156.     if not isAdmin(plr.Name)then return end
  157.    
  158.     str=str:gsub('/e ','')--remove "/e " the easy way!
  159.    
  160.     local t=getprfx(str)
  161.     if t==nil then return end
  162.     str=str:sub(t[2])
  163.     if t[1]=='exec' then
  164.     exec(str)
  165.     elseif t[1]=='cmd' then
  166.     execCmd(str, plr)
  167.     end
  168.     end
  169.    
  170.     updateevents()
  171.     _G.exec_cmd = execCmd
  172.     --game.Players.LocalPlayer.Chatted:connect(doexec)
  173.    
  174.     local _char=function(plr_name)
  175.     for i,v in pairs(game.Players:GetChildren())do
  176.     if v:IsA'Player'then
  177.     if v.Name==plr_name then return v.Character end
  178.     end
  179.     end
  180.     return
  181.     end
  182.    
  183.     local _plr=function(plr_name)
  184.     for i,v in pairs(game.Players:GetChildren())do
  185.     if v:IsA'Player'then
  186.     if v.Name==plr_name then return v end
  187.     end
  188.     end
  189.     return
  190.     end
  191.    
  192.     function addcmd(name,desc,alias,func)
  193.     cmds[#cmds+1]=
  194.     {
  195.     NAME=name;
  196.     DESC=desc;
  197.     ALIAS=alias;
  198.     FUNC=func;
  199.     }
  200.     end
  201.    
  202.     local function getPlayer(name)
  203.     local nameTable = {}
  204.     name=name:lower()
  205.     if name == "me" then
  206.     return {admin}
  207.     elseif name == "others" then
  208.     for i,v in pairs(gPlayers:GetChildren()) do
  209.     if v:IsA'Player'then
  210.     if v.Name~=admin then
  211.     nameTable[#nameTable+1]=v.Name
  212.     end
  213.     end
  214.     end
  215.     elseif name == "all" then
  216.     for i,v in pairs(gPlayers:GetChildren()) do
  217.     if v:IsA'Player'then
  218.     nameTable[#nameTable+1]=v.Name
  219.     end
  220.     end
  221.     else
  222.     for i,v in pairs(gPlayers:GetChildren()) do
  223.     local lname = v.Name:lower()
  224.     local i,j = lname:find(name)
  225.     if i == 1 then
  226.     return {v.Name}
  227.     end
  228.     end
  229.     end
  230.     return nameTable
  231.     end
  232.    
  233.     -- commands --
  234.  
  235.     addcmd('get','Recives your tools you saved',nil,
  236.     function(args)
  237.     for _,v in pairs(game.Players.LocalPlayer:GetChildren()) do
  238.     if (v:IsA("Tool")) then
  239.     v.Parent = game.Players.LocalPlayer.Backpack
  240.     end
  241.     end
  242.     end)
  243.  
  244.  
  245.     addcmd('twrk','makes u twerk',nil,
  246.     function(args)
  247.     Player = "LocalPlayer"
  248.     AnimationId = "277485142"
  249.     local Anim = Instance.new("Animation")
  250.     Anim.AnimationId = "rbxassetid://"..AnimationId
  251.     local k = game.Players[Player].Character.Humanoid:LoadAnimation(Anim)
  252.     k:Play() --Play the animation
  253.     k:AdjustSpeed(1) --Set '1' to any value you want to adjust the animation speed.
  254.     end)
  255.  
  256.     addcmd('spin','makes u twerk',nil,
  257.     function(args)
  258.     Player = "LocalPlayer"
  259.     AnimationId = "277597389"
  260.     local Anim = Instance.new("Animation")
  261.     Anim.AnimationId = "rbxassetid://"..AnimationId
  262.     local k = game.Players[Player].Character.Humanoid:LoadAnimation(Anim)
  263.     k:Play() --Play the animation
  264.     k:AdjustSpeed(1) --Set '1' to any value you want to adjust the animation speed.
  265.     end)
  266.  
  267.     addcmd('kill','kills a player',{},
  268.     function(args)
  269.     local players=getPlayer(args[1])
  270.     for i,v in pairs(players)do
  271.     game.ReplicatedStorage.Event:FireServer("TPD", 200000000000000000000, gPlayers[v].Character.Humanoid)
  272.     end
  273.     end)
  274.  
  275.     addcmd('loopkill','kills a player',{},
  276.     function(args)
  277.     local players=getPlayer(args[1])
  278.     for i,v in pairs(players)do
  279.     bannedplyrs[#bannedplyrs+1]=v
  280.     while true do
  281.     game.ReplicatedStorage.Event:FireServer("TPD", 2000, gPlayers[v].Character.Humanoid)
  282.     wait(0.1)
  283.     end
  284.     end
  285.     end)
  286.  
  287.     addcmd('radio','change moosic sound',{},
  288.     function(args)
  289.     local players=getPlayer(args[1])
  290.     if not args[1]or not args[2]then return end
  291.     local num=args[2]
  292.     for i,v in pairs(players) do
  293.     game.ReplicatedStorage.Event:FireServer("PlayRadio", gPlayers[v], num)
  294.     end
  295.     end)
  296.  
  297.     addcmd('radioban','bans people from using their radio',{},
  298.     function(args)
  299.     local players=getPlayer(args[1])
  300.     for i,v in pairs(players)do
  301.     while true do
  302.     game.ReplicatedStorage.Event:FireServer("PlayRadio", gPlayers[v], 0)
  303.     wait(0.1)
  304.     end
  305.     end
  306.     end)
  307.  
  308.     addcmd('damage','damages a player',{},
  309.     function(args)
  310.     local players=getPlayer(args[1])
  311.     if not args[1]or not args[2]then return end
  312.     local num=args[2]
  313.     for i,v in pairs(players) do
  314.     game.ReplicatedStorage.Event:FireServer("TPD", num, gPlayers[v].Character.Humanoid)
  315.     end
  316.     end)
  317.  
  318.     addcmd('admin','gives a player admin',{},
  319.     function(args)
  320.     if not args[1]then return end
  321.     local players=getPlayer(args[1])
  322.     table.foreach(players,function(k,v)
  323.     admins[v]=true
  324.     end)
  325.     end)
  326.  
  327.     addcmd('unadmin','removes a players admin',{},
  328.     function(args)
  329.     if not args[1] then return end
  330.     local players=getPlayer(args[1])
  331.     table.foreach(players,function(k,v)
  332.     admins[v]=nil
  333.     end)
  334.     end)
  335.  
  336.  
  337.     addcmd('save','Saves your tools',nil,
  338.     function(args)
  339.     for _,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
  340.     if (v:IsA("Tool")) then
  341.     v.Parent = game.Players.LocalPlayer
  342.     end
  343.     end
  344.     end)
  345.    
  346.     addcmd('drop','Drop your tools',nil,
  347.     function(args)
  348.     for _,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
  349.     game.Players.LocalPlayer.Character.Humanoid:EquipTool(v)
  350.     v.Parent = workspace
  351.     end
  352.     end)
  353.    
  354.     addcmd('goto','go to a player',{},
  355.     function(args)
  356.     local players=getPlayer(args[1])
  357.     if players ~= nil and _char(players[1]):FindFirstChild("HumanoidRootPart") then
  358.     _char(admin).HumanoidRootPart.CFrame = _char(players[1]).HumanoidRootPart.CFrame
  359.     end
  360.     end)
  361.  
  362.     addcmd('ws','change a players walkspeed',{},
  363.     function(args)
  364.     local players=getPlayer(args[1])
  365.     if not args[1]or not args[2]then return end
  366.     local num=args[2]
  367.     for i,v in pairs(players) do
  368.     if _char(v):FindFirstChild("Humanoid") then
  369.     _char(v).Humanoid.WalkSpeed=tonumber(num)
  370.     end
  371.     end
  372.     end)
  373.    
  374.     addcmd('noclothes','Removes your clothes',nil,
  375.     function(args)
  376.     local pchar = game.Players.LocalPlayer.Character
  377.     if pchar:FindFirstChild("Shirt") then
  378.         pchar.Shirt:Destroy()
  379.     end
  380.     if pchar:FindFirstChild("Pants") then
  381.         pchar.Pants:Destroy()
  382.     end
  383.     if pchar:FindFirstChild("Shirt Graphic") then
  384.         pchar["Shirt Graphic"].Graphic = ""
  385.     end
  386.     end)
  387.  
  388.     addcmd('nohats','Remove the hats from your character',nil,
  389.     function(args)
  390.     for _,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
  391.     if v:IsA'Accoutrement' then
  392.     v.Parent=game.Players.LocalPlayer.Character
  393.     v.Parent = workspace.Terrain
  394.     end
  395.     end
  396.     for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  397.     if v:IsA'Accoutrement' then
  398.     for ape,hax in pairs(v.Handle:GetChildren()) do
  399.     hax:Destroy()
  400.     end
  401.     wait'.1'
  402.     v.Parent=game.Players.LocalPlayer.StarterGear
  403.     end
  404.     end
  405.     end)
  406.  
  407. addcmd('fly','makes u fly',nil,
  408. function(args)
  409. mouse=game.Players.LocalPlayer:GetMouse''
  410. localplayer=game.Players.LocalPlayer
  411. game.Players.LocalPlayer.Character:WaitForChild("Torso")
  412.         local torso = game.Players.LocalPlayer.Character.Torso
  413.         local flying = true
  414.         local speed=0
  415.         local keys={a=false,d=false,w=false,s=false}
  416.         local e1
  417.         local e2
  418.         local function start()
  419.             local pos = Instance.new("BodyPosition",torso)
  420.             local gyro = Instance.new("BodyGyro",torso)
  421.             pos.Name="EPIXPOS"
  422.             pos.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  423.             pos.position = torso.Position
  424.             gyro.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  425.             gyro.cframe = torso.CFrame
  426.             repeat
  427.                 wait()
  428.                 localplayer.Character.Humanoid.PlatformStand=true
  429.                 local new=gyro.cframe - gyro.cframe.p + pos.position
  430.                 if not keys.w and not keys.s and not keys.a and not keys.d then
  431.                     speed=1
  432.                 end
  433.                 if keys.w then
  434.                     new = new + workspace.CurrentCamera.CoordinateFrame.lookVector * speed
  435.                     speed=speed+0.01
  436.                 end
  437.                 if keys.s then
  438.                     new = new - workspace.CurrentCamera.CoordinateFrame.lookVector * speed
  439.                     speed=speed+0.01
  440.                 end
  441.                 if keys.d then
  442.                     new = new * CFrame.new(speed,0,0)
  443.                     speed=speed+0.01
  444.                 end
  445.                 if keys.a then
  446.                     new = new * CFrame.new(-speed,0,0)
  447.                     speed=speed+0.01
  448.                 end
  449.                 if speed>5 then
  450.                     speed=5
  451.                 end
  452.                 pos.position=new.p
  453.                 if keys.w then
  454.                     gyro.cframe = workspace.CurrentCamera.CoordinateFrame*CFrame.Angles(-math.rad(speed*15),0,0)
  455.                 elseif keys.s then
  456.                     gyro.cframe = workspace.CurrentCamera.CoordinateFrame*CFrame.Angles(math.rad(speed*15),0,0)
  457.                 else
  458.                     gyro.cframe = workspace.CurrentCamera.CoordinateFrame
  459.                 end
  460.             until flying==false
  461.             if gyro then gyro:Destroy() end
  462.             if pos then pos:Destroy() end
  463.             flying=false
  464.             localplayer.Character.Humanoid.PlatformStand=false
  465.             speed=0
  466.         end
  467.         e1=mouse.KeyDown:connect(function(key)
  468.             if not torso or not torso.Parent then flying=false e1:disconnect() e2:disconnect() return end
  469.             if key=="w" then
  470.                 keys.w=true
  471.             elseif key=="s" then
  472.                 keys.s=true
  473.             elseif key=="a" then
  474.                 keys.a=true
  475.             elseif key=="d" then
  476.                 keys.d=true
  477.             elseif key=="e" then
  478.                 if flying==true then
  479.                     flying=false
  480.                 else
  481.                     flying=true
  482.                     start()
  483.                 end
  484.             end
  485.         end)
  486.         e2=mouse.KeyUp:connect(function(key)
  487.             if key=="w" then
  488.                 keys.w=false
  489.             elseif key=="s" then
  490.                 keys.s=false
  491.             elseif key=="a" then
  492.                 keys.a=false
  493.             elseif key=="d" then
  494.                 keys.d=false
  495.             end
  496.         end)
  497.         start()
  498. end)
  499.  
  500.     addcmd('hatspin','Makes your hats spin',nil,
  501.     function(args)
  502.     local obese = game:GetService('Players')
  503.     for i,v in pairs(obese.LocalPlayer.Character:GetChildren()) do
  504.     if v.ClassName == "Accessory" then
  505.     local stg = v.Handle:FindFirstChildOfClass("BodyForce")
  506.     if stg == nil then
  507.     local a = Instance.new("BodyPosition")
  508.     local b = Instance.new("BodyAngularVelocity")
  509.     a.Parent = v.Handle
  510.     b.Parent = v.Handle
  511.     v.Handle.AccessoryWeld:Destroy()
  512.     b.AngularVelocity = Vector3.new(0,100,0)
  513.     b.MaxTorque = Vector3.new(0,200,0)
  514.     a.P = 30000
  515.     a.D = 50
  516.     game:GetService('RunService').Stepped:connect(function()
  517.     a.Position = obese.LocalPlayer.Character.Head.Position
  518.     end)
  519.     end
  520.     end
  521.     end
  522.     end)
  523.    
  524.    
  525.     addcmd('invis','Anchors character',nil,
  526.     function(args)
  527.     Local = game:GetService('Players').LocalPlayer
  528.     Char  = Local.Character
  529.     touched,tpdback = false, false
  530.     Local.CharacterAdded:connect(function(char)
  531.         if script.Disabled ~= true then
  532.             wait(.25)
  533.             loc = Char.HumanoidRootPart.Position
  534.             Char:MoveTo(box.Position + Vector3.new(0,.5,0))
  535.         end
  536.     end)
  537.     game:GetService('UserInputService').InputBegan:connect(function(key)
  538.         if key.KeyCode == Enum.KeyCode.Equals then
  539.             if script.Disabled ~= true then
  540.                 script.Disabled = true
  541.                 print'you may re-execute'
  542.             end
  543.         end
  544.     end)
  545.     box = Instance.new('Part',workspace)
  546.     box.Anchored = true
  547.     box.CanCollide = true
  548.     box.Size = Vector3.new(10,1,10)
  549.     box.Position = Vector3.new(0,10000,0)
  550.     box.Touched:connect(function(part)
  551.         if (part.Parent.Name == Local.Name) then
  552.             if touched == false then
  553.                 touched = true
  554.                 function apply()
  555.                     if script.Disabled ~= true then
  556.                         no = Char.HumanoidRootPart:Clone()
  557.                         wait(.25)
  558.                         Char.HumanoidRootPart:Destroy()
  559.                         no.Parent = Char
  560.                         Char:MoveTo(loc)
  561.                         touched = false
  562.                     end end
  563.                 if Char then
  564.                     apply()
  565.                 end
  566.             end
  567.         end
  568.     end)
  569.     repeat wait() until Char
  570.     loc = Char.HumanoidRootPart.Position
  571.     Char:MoveTo(box.Position + Vector3.new(0,.5,0))
  572.     end)
  573.    
  574.     addcmd('ibtools','Unachors character',nil,
  575.     function(args)
  576.     loadstring(game:GetObjects('rbxassetid://552440069')[1].Source)()
  577.     end)
  578.  
  579.     addcmd('view','view player',{},
  580.     function(args)
  581.     local players=getPlayer(args[1])
  582.     workspace.CurrentCamera.CameraSubject = game.Players[players[1]].Character
  583.     end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top