game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg)
local 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
if msg:lower():sub(1,5) == "give " and plr:GetRankInGroup(2560312) >= 4 then
local chk1 = msg:lower():sub(6):find(" ") + 5
local plrz = GetPlr(plr, msg:lower():sub(6,chk1-1))
for i, v in pairs(plrz) do
if v and v:findFirstChild("Backpack") and game:findFirstChild("ServerStorage") then
for a, tool in pairs(game.ServerStorage:children()) do
if tool:IsA("Tool") or tool:IsA("HopperBin") then
if tool.Name:lower():find(msg:lower():sub(chk1+1)) == 1 then
tool:Clone().Parent = v.Backpack
print(plr.Name)
print(tool.Name)
local S = game.Workspace.Manage.SurfaceGui
local Ok = Color3.new(0/255,184/255,6/255)
local OkS = Color3.new(255/255,255/255,255/255)
local NoS = Color3.new(184/255,0/255,0/255)
local No = Color3.new(184/255,0/255,0/255)
print(tool.Name:lower():sub(5))
local N = tool.Name:lower():sub(6)
print(tool.Name:reverse():lower():sub(7) )
if(tool.Name:reverse():lower():sub(7) == "us") then
R = N.."S"
X = S.Rooms:findFirstChild(R)
print(R)
else
print(R)
R = N
X = S.Rooms:findFirstChild(R)
end
local children = workspace.Manage.SurfaceGui.Rooms:GetChildren()
for i = 1, #children do
repeat wait() until children[i]
if(children[i].Name == R) then
T = children[i].Taken
if(T.Value == 0) then
X.BackgroundColor3 = No
X.N1.Text = v.Name
T.Value = 1
elseif (T.Value == 1) then
end
end
end
print(tostring(N.."S"))
print(N)
end
end
end
end
end
end
end)
end)
Comments