Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gPlayers = game:GetService("Players")
- local admin = gPlayers.LocalPlayer.Name
- local bannedplyrs = {'PeopleYouHate','MorePeopleYouHate'}
- local admins = {'Friend, Friend'} -- names here of people who have access to your commands! (Your name doesn't need to be in here.)
- -- declare services / init stuff --
- local services={}
- local cmds={}
- local std={}
- local serverLocked = false
- function FIX_LIGHTING()
- game.Lighting.Ambient = Color3.new(0.5, 0.5, 0.5)
- game.Lighting.Brightness = 1
- game.Lighting.GlobalShadows = true
- game.Lighting.Outlines = false
- game.Lighting.TimeOfDay = 14
- game.Lighting.FogEnd = 100000
- end
- services.players=gPlayers
- services.lighting=game:GetService('Lighting')
- services.workspace=game:GetService('Workspace')
- services.events = {}
- local user = gPlayers.LocalPlayer
- local cmdprefix = ''
- local scriptprefix = '/'
- local split = " "
- updateevents=function()
- for i,v in pairs(services.events) do services.events:remove(i) v:disconnect() end
- for i,v in pairs(gPlayers:players())do
- local ev = v.Chatted:connect(function(msg) do_exec(msg,v) end)
- services.events[#services.events+1] = ev
- end
- end
- std.inTable=function(tbl,val)
- if tbl==nil then return false end
- for _,v in pairs(tbl)do
- if v==val then return true end
- end
- return false
- end
- std.out=function(str)
- print(str)
- end
- std.list=function(tbl) --turns table into list with commas
- local str=''
- for i,v in pairs(tbl)do
- str=str..tostring(v)
- if i~=#tbl then str=str..', ' end
- end
- return str
- end
- std.endat=function(str,val)
- local z=str:find(val)
- if z then
- return str:sub(0,z-string.len(val)),true
- else
- return str,false
- end
- end
- std.first=function(str) return str:sub(1,1) end
- isAdmin=function(name)
- if name==admin then
- return true
- elseif admins[name]==true then
- return true
- end
- return false
- end
- gPlayers.PlayerAdded:connect(function(player)
- for i,v in pairs(bannedplyrs) do
- game.ReplicatedStorage.Event:FireServer("TPD", 2000, gPlayers[v].Character.Humanoid)
- end
- end)
- local exec=function(str)
- spawn(function()
- local script, loaderr = loadstring(str)
- if not script then
- error(loaderr)
- else
- script()
- end
- end)
- end
- local findCmd=function(cmd_name)
- for i,v in pairs(cmds)do
- if v.NAME:lower()==cmd_name:lower() or std.inTable(v.ALIAS,cmd_name:lower())then
- return v
- end
- end
- end
- local getCmd=function(msg)
- local cmd,hassplit=std.endat(msg:lower(),split)
- if hassplit then
- return {cmd,true}
- else
- return {cmd,false}
- end
- end
- local getprfx=function(strn)
- if strn:sub(1,string.len(cmdprefix))==cmdprefix then return{'cmd',string.len(cmdprefix)+1}
- elseif strn:sub(1,string.len(scriptprefix))==scriptprefix then return{'exec',string.len(scriptprefix)+1}
- end return
- end
- local getArgs=function(str)
- local args={}
- local new_arg=nil
- local hassplit=nil
- local s=str
- repeat
- new_arg,hassplit=std.endat(s:lower(),split)
- if new_arg~='' then
- args[#args+1]=new_arg
- s=s:sub(string.len(new_arg)+string.len(split)+1)
- end
- until hassplit==false
- return args
- end
- local function execCmd(str, plr)
- local s_cmd
- local a
- local cmd
- s_cmd = getCmd(str) --separate command from string using split {command name,arg bool (for arg system)}
- cmd = findCmd(s_cmd[1]) --get command object {NAME,DESC,{ALIASES},function(args)}
- if cmd == nil then return end
- a = str:sub(string.len(s_cmd[1]) + string.len(split) + 1)--start string "a" after command and split
- local args=getArgs(a)--gets us a nice table of arguments
- pcall(function()
- cmd.FUNC(args, plr)
- end)
- end
- function do_exec(str,plr)
- if not isAdmin(plr.Name)then return end
- str=str:gsub('/e ','')--remove "/e " the easy way!
- local t=getprfx(str)
- if t==nil then return end
- str=str:sub(t[2])
- if t[1]=='exec' then
- exec(str)
- elseif t[1]=='cmd' then
- execCmd(str, plr)
- end
- end
- updateevents()
- _G.exec_cmd = execCmd
- --game.Players.LocalPlayer.Chatted:connect(doexec)
- local _char=function(plr_name)
- for i,v in pairs(game.Players:GetChildren())do
- if v:IsA'Player'then
- if v.Name==plr_name then return v.Character end
- end
- end
- return
- end
- local _plr=function(plr_name)
- for i,v in pairs(game.Players:GetChildren())do
- if v:IsA'Player'then
- if v.Name==plr_name then return v end
- end
- end
- return
- end
- function addcmd(name,desc,alias,func)
- cmds[#cmds+1]=
- {
- NAME=name;
- DESC=desc;
- ALIAS=alias;
- FUNC=func;
- }
- end
- local function getPlayer(name)
- local nameTable = {}
- name=name:lower()
- if name == "me" then
- return {admin}
- elseif name == "others" then
- for i,v in pairs(gPlayers:GetChildren()) do
- if v:IsA'Player'then
- if v.Name~=admin then
- nameTable[#nameTable+1]=v.Name
- end
- end
- end
- elseif name == "all" then
- for i,v in pairs(gPlayers:GetChildren()) do
- if v:IsA'Player'then
- nameTable[#nameTable+1]=v.Name
- end
- end
- else
- for i,v in pairs(gPlayers:GetChildren()) do
- local lname = v.Name:lower()
- local i,j = lname:find(name)
- if i == 1 then
- return {v.Name}
- end
- end
- end
- return nameTable
- end
- -- commands --
- addcmd('get','Recives your tools you saved',nil,
- function(args)
- for _,v in pairs(game.Players.LocalPlayer:GetChildren()) do
- if (v:IsA("Tool")) then
- v.Parent = game.Players.LocalPlayer.Backpack
- end
- end
- end)
- addcmd('twrk','makes u twerk',nil,
- function(args)
- Player = "LocalPlayer"
- AnimationId = "277485142"
- local Anim = Instance.new("Animation")
- Anim.AnimationId = "rbxassetid://"..AnimationId
- local k = game.Players[Player].Character.Humanoid:LoadAnimation(Anim)
- k:Play() --Play the animation
- k:AdjustSpeed(1) --Set '1' to any value you want to adjust the animation speed.
- end)
- addcmd('spin','makes u twerk',nil,
- function(args)
- Player = "LocalPlayer"
- AnimationId = "277597389"
- local Anim = Instance.new("Animation")
- Anim.AnimationId = "rbxassetid://"..AnimationId
- local k = game.Players[Player].Character.Humanoid:LoadAnimation(Anim)
- k:Play() --Play the animation
- k:AdjustSpeed(1) --Set '1' to any value you want to adjust the animation speed.
- end)
- addcmd('kill','kills a player',{},
- function(args)
- local players=getPlayer(args[1])
- for i,v in pairs(players)do
- game.ReplicatedStorage.Event:FireServer("TPD", 200000000000000000000, gPlayers[v].Character.Humanoid)
- end
- end)
- addcmd('loopkill','kills a player',{},
- function(args)
- local players=getPlayer(args[1])
- for i,v in pairs(players)do
- bannedplyrs[#bannedplyrs+1]=v
- while true do
- game.ReplicatedStorage.Event:FireServer("TPD", 2000, gPlayers[v].Character.Humanoid)
- wait(0.1)
- end
- end
- end)
- addcmd('radio','change moosic sound',{},
- function(args)
- local players=getPlayer(args[1])
- if not args[1]or not args[2]then return end
- local num=args[2]
- for i,v in pairs(players) do
- game.ReplicatedStorage.Event:FireServer("PlayRadio", gPlayers[v], num)
- end
- end)
- addcmd('radioban','bans people from using their radio',{},
- function(args)
- local players=getPlayer(args[1])
- for i,v in pairs(players)do
- while true do
- game.ReplicatedStorage.Event:FireServer("PlayRadio", gPlayers[v], 0)
- wait(0.1)
- end
- end
- end)
- addcmd('damage','damages a player',{},
- function(args)
- local players=getPlayer(args[1])
- if not args[1]or not args[2]then return end
- local num=args[2]
- for i,v in pairs(players) do
- game.ReplicatedStorage.Event:FireServer("TPD", num, gPlayers[v].Character.Humanoid)
- end
- end)
- addcmd('admin','gives a player admin',{},
- function(args)
- if not args[1]then return end
- local players=getPlayer(args[1])
- table.foreach(players,function(k,v)
- admins[v]=true
- end)
- end)
- addcmd('unadmin','removes a players admin',{},
- function(args)
- if not args[1] then return end
- local players=getPlayer(args[1])
- table.foreach(players,function(k,v)
- admins[v]=nil
- end)
- end)
- addcmd('save','Saves your tools',nil,
- function(args)
- for _,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
- if (v:IsA("Tool")) then
- v.Parent = game.Players.LocalPlayer
- end
- end
- end)
- addcmd('drop','Drop your tools',nil,
- function(args)
- for _,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
- game.Players.LocalPlayer.Character.Humanoid:EquipTool(v)
- v.Parent = workspace
- end
- end)
- addcmd('goto','go to a player',{},
- function(args)
- local players=getPlayer(args[1])
- if players ~= nil and _char(players[1]):FindFirstChild("HumanoidRootPart") then
- _char(admin).HumanoidRootPart.CFrame = _char(players[1]).HumanoidRootPart.CFrame
- end
- end)
- addcmd('ws','change a players walkspeed',{},
- function(args)
- local players=getPlayer(args[1])
- if not args[1]or not args[2]then return end
- local num=args[2]
- for i,v in pairs(players) do
- if _char(v):FindFirstChild("Humanoid") then
- _char(v).Humanoid.WalkSpeed=tonumber(num)
- end
- end
- end)
- addcmd('noclothes','Removes your clothes',nil,
- function(args)
- local pchar = game.Players.LocalPlayer.Character
- if pchar:FindFirstChild("Shirt") then
- pchar.Shirt:Destroy()
- end
- if pchar:FindFirstChild("Pants") then
- pchar.Pants:Destroy()
- end
- if pchar:FindFirstChild("Shirt Graphic") then
- pchar["Shirt Graphic"].Graphic = ""
- end
- end)
- addcmd('nohats','Remove the hats from your character',nil,
- function(args)
- for _,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
- if v:IsA'Accoutrement' then
- v.Parent=game.Players.LocalPlayer.Character
- v.Parent = workspace.Terrain
- end
- end
- for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
- if v:IsA'Accoutrement' then
- for ape,hax in pairs(v.Handle:GetChildren()) do
- hax:Destroy()
- end
- wait'.1'
- v.Parent=game.Players.LocalPlayer.StarterGear
- end
- end
- end)
- addcmd('fly','makes u fly',nil,
- function(args)
- mouse=game.Players.LocalPlayer:GetMouse''
- localplayer=game.Players.LocalPlayer
- game.Players.LocalPlayer.Character:WaitForChild("Torso")
- local torso = game.Players.LocalPlayer.Character.Torso
- local flying = true
- local speed=0
- local keys={a=false,d=false,w=false,s=false}
- local e1
- local e2
- local function start()
- local pos = Instance.new("BodyPosition",torso)
- local gyro = Instance.new("BodyGyro",torso)
- pos.Name="EPIXPOS"
- pos.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- pos.position = torso.Position
- gyro.maxTorque = Vector3.new(9e9, 9e9, 9e9)
- gyro.cframe = torso.CFrame
- repeat
- wait()
- localplayer.Character.Humanoid.PlatformStand=true
- local new=gyro.cframe - gyro.cframe.p + pos.position
- if not keys.w and not keys.s and not keys.a and not keys.d then
- speed=1
- end
- if keys.w then
- new = new + workspace.CurrentCamera.CoordinateFrame.lookVector * speed
- speed=speed+0.01
- end
- if keys.s then
- new = new - workspace.CurrentCamera.CoordinateFrame.lookVector * speed
- speed=speed+0.01
- end
- if keys.d then
- new = new * CFrame.new(speed,0,0)
- speed=speed+0.01
- end
- if keys.a then
- new = new * CFrame.new(-speed,0,0)
- speed=speed+0.01
- end
- if speed>5 then
- speed=5
- end
- pos.position=new.p
- if keys.w then
- gyro.cframe = workspace.CurrentCamera.CoordinateFrame*CFrame.Angles(-math.rad(speed*15),0,0)
- elseif keys.s then
- gyro.cframe = workspace.CurrentCamera.CoordinateFrame*CFrame.Angles(math.rad(speed*15),0,0)
- else
- gyro.cframe = workspace.CurrentCamera.CoordinateFrame
- end
- until flying==false
- if gyro then gyro:Destroy() end
- if pos then pos:Destroy() end
- flying=false
- localplayer.Character.Humanoid.PlatformStand=false
- speed=0
- end
- e1=mouse.KeyDown:connect(function(key)
- if not torso or not torso.Parent then flying=false e1:disconnect() e2:disconnect() return end
- if key=="w" then
- keys.w=true
- elseif key=="s" then
- keys.s=true
- elseif key=="a" then
- keys.a=true
- elseif key=="d" then
- keys.d=true
- elseif key=="e" then
- if flying==true then
- flying=false
- else
- flying=true
- start()
- end
- end
- end)
- e2=mouse.KeyUp:connect(function(key)
- if key=="w" then
- keys.w=false
- elseif key=="s" then
- keys.s=false
- elseif key=="a" then
- keys.a=false
- elseif key=="d" then
- keys.d=false
- end
- end)
- start()
- end)
- addcmd('hatspin','Makes your hats spin',nil,
- function(args)
- local obese = game:GetService('Players')
- for i,v in pairs(obese.LocalPlayer.Character:GetChildren()) do
- if v.ClassName == "Accessory" then
- local stg = v.Handle:FindFirstChildOfClass("BodyForce")
- if stg == nil then
- local a = Instance.new("BodyPosition")
- local b = Instance.new("BodyAngularVelocity")
- a.Parent = v.Handle
- b.Parent = v.Handle
- v.Handle.AccessoryWeld:Destroy()
- b.AngularVelocity = Vector3.new(0,100,0)
- b.MaxTorque = Vector3.new(0,200,0)
- a.P = 30000
- a.D = 50
- game:GetService('RunService').Stepped:connect(function()
- a.Position = obese.LocalPlayer.Character.Head.Position
- end)
- end
- end
- end
- end)
- addcmd('invis','Anchors character',nil,
- function(args)
- Local = game:GetService('Players').LocalPlayer
- Char = Local.Character
- touched,tpdback = false, false
- Local.CharacterAdded:connect(function(char)
- if script.Disabled ~= true then
- wait(.25)
- loc = Char.HumanoidRootPart.Position
- Char:MoveTo(box.Position + Vector3.new(0,.5,0))
- end
- end)
- game:GetService('UserInputService').InputBegan:connect(function(key)
- if key.KeyCode == Enum.KeyCode.Equals then
- if script.Disabled ~= true then
- script.Disabled = true
- print'you may re-execute'
- end
- end
- end)
- box = Instance.new('Part',workspace)
- box.Anchored = true
- box.CanCollide = true
- box.Size = Vector3.new(10,1,10)
- box.Position = Vector3.new(0,10000,0)
- box.Touched:connect(function(part)
- if (part.Parent.Name == Local.Name) then
- if touched == false then
- touched = true
- function apply()
- if script.Disabled ~= true then
- no = Char.HumanoidRootPart:Clone()
- wait(.25)
- Char.HumanoidRootPart:Destroy()
- no.Parent = Char
- Char:MoveTo(loc)
- touched = false
- end end
- if Char then
- apply()
- end
- end
- end
- end)
- repeat wait() until Char
- loc = Char.HumanoidRootPart.Position
- Char:MoveTo(box.Position + Vector3.new(0,.5,0))
- end)
- addcmd('ibtools','Unachors character',nil,
- function(args)
- loadstring(game:GetObjects('rbxassetid://552440069')[1].Source)()
- end)
- addcmd('view','view player',{},
- function(args)
- local players=getPlayer(args[1])
- workspace.CurrentCamera.CameraSubject = game.Players[players[1]].Character
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement