Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

admin commands Help?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

My admin commands have no errors, nothing in the output and Dont stop the game when I test it, and none of the commands work... Any help?

-- made by amegaman and robomax11
----------------------
-- LIST OF COMMANDS --
----------------------
--[[
1 KILL ?
2 RESPAWN 
3 KICK ?
4 BAN
5 CLONE
6 TELEPORT -- NO
7 MESSAGE
8 PRIVATE MESSAGE -- NO
9 HINT
10 SERVER MESSAGE
11 SHUTDOWN
12 GIVE_TOOL -- NO
13 MUSIC
14 SHIRT -- NO
15 PANTS -- NO
16 HATS -- NO
17 FACES -- NO
18 INVISIBLE ?
19 PACKAGES -- NO
20 GOD ?
21 VISIBLE ? 
22 CLEAN
23 PLACE 
24 CHANGE PREFIX
25 ADMIN
26 FLING
27 FREEZE
28 THAW
29 HEAL
30 DAMAGE
31 ADVANCE CLONE
32 LS
33 S
34 LOCK SERVER/SLOCK
35 UNLOCK SERVER/UNSLOCK
36 CHANGE SKIN COLOR -- NO
37 FF
38 UNFF
39 G
]]--

admins = {"amegaman","robomax11"}
bans = {"sumnub"}
local p = '!'

local group_admin = false
local group_id = 1009411

function GetPlr(plr, str)
local plrz = {} str = str:lower()
if str == "all" then plrz = game.Players:children()
elseif str == "others" then for i, v in pairs(game.Players:children()) do if v ~= plr then table.insert(plrz, v) end end
else
local sn = {1} local en = {}
for i = 1, #str do if str:sub(i,i) == "," then table.insert(sn, i+1) table.insert(en,i-1) end end
for x = 1, #sn do 
if (sn[x] and en[x] and str:sub(sn[x],en[x]) == "me") or (sn[x] and str:sub(sn[x]) == "me") then table.insert(plrz, plr)
elseif (sn[x] and en[x] and str:sub(sn[x],en[x]) == "random") or (sn[x] and str:sub(sn[x]) == "random") then table.insert(plrz, game.Players:children()[math.random(#game.Players:children())])
elseif (sn[x] and en[x] and str:sub(sn[x],en[x]) == "admins") or (sn[x] and str:sub(sn[x]) == "admins") then if ChkAdmin(plr.Name, true) then for i, v in pairs(game.Players:children()) do if ChkAdmin(v.Name, false) then table.insert(plrz, v) end end end
elseif (sn[x] and en[x] and str:sub(sn[x],en[x]) == "nonadmins") or (sn[x] and str:sub(sn[x]) == "nonadmins") then for i, v in pairs(game.Players:children()) do if not ChkAdmin(v.Name, false) then table.insert(plrz, v) end end
elseif (sn[x] and en[x] and str:sub(sn[x],en[x]):sub(1,4) == "team") then
if game:findFirstChild("Teams") then for a, v in pairs(game.Teams:children()) do if v:IsA("Team") and str:sub(sn[x],en[x]):sub(6) ~= "" and v.Name:lower():find(str:sub(sn[x],en[x]):sub(6)) == 1 then 
for q, p in pairs(game.Players:children()) do if p.TeamColor == v.TeamColor then table.insert(plrz, p) end end break
end end end
elseif (sn[x] and str:sub(sn[x]):sub(1,4):lower() == "team") then
if game:findFirstChild("Teams") then for a, v in pairs(game.Teams:children()) do if v:IsA("Team") and str:sub(sn[x],en[x]):sub(6) ~= "" and v.Name:lower():find(str:sub(sn[x]):sub(6)) == 1 then 
for q, p in pairs(game.Players:children()) do if p.TeamColor == v.TeamColor then table.insert(plrz, p) end end break
end end end
else
for a, plyr in pairs(game.Players:children()) do 
if (sn[x] and en[x] and str:sub(sn[x],en[x]) ~= "" and plyr.Name:lower():find(str:sub(sn[x],en[x])) == 1) or (sn[x] and str:sub(sn[x]) ~= "" and plyr.Name:lower():find(str:sub(sn[x])) == 1) or (str ~= "" and plyr.Name:lower():find(str) == 1) then 
table.insert(plrz, plyr) break
end
end 
end
end
end
return plrz
end

game.Players.PlayerAdded:connect(function(plr)
 if bans[plr.Name] then
 plr:Kick()
 end
 if plr.userId == game.CreatorId and not admin[plr.Name] then
 table.insert(admins, plr.Name)
 end
end)

game.Players.PlayerAdded:connect(function(p)
if admins[p.Name] then
p.Chatted:connect(function(msg)
if msg:lower():sub(1, 6) == p.."kill " then
local plrz = GetPlr(p, msg:lower():sub(7))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
if v.Character and v then
v:BreakJoints()
end
end))
end
end

if msg:lower():sub(1, 5) == p.."god " then
local plrz = GetPlr(p, msg:lower():sub(6))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
if v and v.Character then
v.Humanoid.MaxHealth = math.huge
v.Humanoid.Healh = math.huge
end
end))
end
end

if msg:lower():sub(1, 11) == p.."invisible " then
local plrz = GetPlr(p, msg:lower():sub(12))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
for index, value in pairs(v.Character:GetChildren()) do
if value:IsA('BasePart') then
value.Transparency = 1
end
end
end))
end
end

if msg:lower():sub(1, 9) == p.."visible " then
local plrz = GetPlr(p, msg:lower():sub(10))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
for index, value in pairs(v.Character:GetChildren()) do
if value:IsA('BasePart') then
value.Transparency = 0
end
end
end))
end
end

if msg:lower():sub(1, 7) == p.."admin " then
local plrz = GetPlr(p, msg:lower():sub(8))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
table.insert(admins, v.Name)
end))
end
end

if msg:lower():sub(1, 6) == p.."kick " then
local plrz = GetPlr(p, msg:lower():sub(7))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
v:Kick()
end))
end
end

if msg:lower():sub(1, 4) == p.."ff " then
local plrz = GetPlr(p, msg:lower():sub(5))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
local c = Instance.new('ForceField', v.Character.Torso)
end))
end
end

if msg:lower():sub(1, 6) == p.."unff " then
local plrz = GetPlr(p, msg:lower():sub(7))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
local ff = v.Character.Torso:findFirstChild('ForceField')
if ff then
ff:Destroy()
end
end))
end



--DONT MESS BELOW THIS LINE--
end
end)
end
end)
0
Sorry I just can't read the text without tabs its confusing me. Vividex 162 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

If you are testing it locally you need to add Player1 to the admin list ?

admins = {"amegaman","robomax11","Player1"}
Ad
Log in to vote
0
Answered by 10 years ago

Depends if you were testing it or not. Otherwise, I am not the guy to answer this.

If you were testing, add Player1 to admins.

0
I test it in an Actual Server. IcyEvil 260 — 10y

Answer this question