Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Admins = {"Existence_YT"}
- local Prefix = "!"
- function checkAdmin(name)
- for i, v in pairs(Admins) do
- if v == name then return true else return false end
- end
- end
- function setOutput(plr, text)
- plr.PlayerGui.AdminBar.MainFrame.Output.Text = tostring(text)
- wait(5)
- plr.PlayerGui.AdminBar.MainFrame.Output.Text = ""
- end
- function execCommand(cmd, plr)
- local args = cmd:split(" ")
- if args[1] == Prefix.."Kill" then
- if game.Players:FindFirstChild(args[2]) then
- game.Players:FindFirstChild(args[2]).Character.Humanoid.Health = 0
- else
- setOutput(plr, "Player Not Found, "..tostring(args[2]))
- end
- elseif args[1] == Prefix.."Speed" then
- if game.Players:FindFirstChild(args[2]) then
- if args[3] then
- game.Players:FindFirstChild(args[2]).Character.Humanoid.WalkSpeed = tonumber(args[3])
- else
- setOutput(plr, "Invalid Argument, "..tostring(args[3]))
- end
- else
- setOutput(plr, "Player Not Found, "..tostring(args[2]))
- end
- elseif args[1] == Prefix.."Jump" then
- if game.Players:FindFirstChild(args[2]) then
- if args[3] then
- game.Players:FindFirstChild(args[2]).Character.Humanoid.JumpPower = tonumber(args[3])
- else
- setOutput(plr, "Invalid Argument, "..tostring(args[3]))
- end
- else
- setOutput(plr, "Player Not Found, "..tostring(args[2]))
- end
- elseif args[1] == Prefix.."Bring" then
- if game.Players:FindFirstChild(args[2]) then
- game.Players:FindFirstChild(args[2]).Character.HumanoidRootPart.CFrame = plr.Character.HumanoidRootPart.CFrame + Vector3.new(0, 2, 0)
- else
- setOutput(plr, "Player Not Found, "..tostring(args[2]))
- end
- elseif args[1] == Prefix.."Goto" then
- if game.Players:FindFirstChild(args[2]) then
- plr.Character.HumanoidRootPart.CFrame = game.Players:FindFirstChild(args[2]).Character.HumanoidRootPart.CFrame + Vector3.new(0, 2, 0)
- else
- setOutput(plr, "Player Not Found, "..tostring(args[2]))
- end
- end
- end
- game.ReplicatedStorage.Remotes.ExecuteCommand.OnServerEvent:Connect(function(plr, cmd)
- if checkAdmin(plr.Name) then
- execCommand(cmd, plr)
- else
- setOutput(plr, "Invalid Permission Level")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment