haha, I;ve got the command set up, just a simple server script when a player says /tog it will fire. But would I have to put it in the command function?
My command script:
local prefix = '/'
local admins = {'wayIxn', 'W0Qk'}
local bans = {}
--// Functions
local function ban(plr)
table.insert(bans, plr)
plr:Kick('You have been banned from this server.')
print(plr.Name..' has been temporarily banned.')
end
local function kick(plr)
plr:Kick('You have been kicked from this server by an administrator.')
print(plr.Name..' has been kicked from the server.')
end
local function pban(plr)
plr.Stats.IsPbanned.Value = true
plr:Kick('You have been permanently banned from this game.')
print(plr.Name..' has been permanently banned from the game.')
end
local togTag = true
local function showTag(plr)
if togTag == true then
togTag = false
plr.TempStats.ShowTag.Value = false
else
togTag = true
plr.TempStats.ShowTag.Value = true
end
end
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:connect(function(msg)
for i = 1, #admins do
if plr.Name == admins[i] then
if msg:sub(1,5):lower() == prefix..'ban ' then
for _,v in pairs(game.Players:GetChildren()) do
if v:FindFirstChild('PlayerGui') and v.Name:lower():match(msg:sub(6):lower()) then
ban(v)
end
end
elseif msg:sub(1,6):lower() == prefix..'pban ' then
for _,v in pairs(game.Players:GetChildren()) do
if v:FindFirstChild('PlayerGui') and v.Name:lower():match(msg:sub(7):lower()) then
pban(v)
end
end
elseif msg:sub(1,6):lower() == prefix..'kick ' then
for _,v in pairs(game.Players:GetChildren()) do
if v:FindFirstChild('PlayerGui') and v.Name:lower():match(msg:sub(7):lower()) then
kick(v)
end
end
elseif msg:sub(1,4):lower() == prefix..'tog' then
togTag(plr)
end
end
end
end)
end)
local function showTag(plr)
if togTag == true then
togTag = false
plr.TempStats.ShowTag.Value = false
else
togTag = true
plr.TempStats.ShowTag.Value = true
end
end