--[[
 I update this command script alot, so if you want to get the newest version of the script, go to http://www.roblox.com/Item.aspx?ID=5277383 every once in a while.

If theres anything you think this command script needs, just message me (Person299) and i might put it in. :)
And also, if you find any bugs, report them to me.

The commands are,

commands
Shows a list of all the commands

fix
If the command script breaks for you, say this to fix it                   --also if your not in edit/build mode and you dont no the commands say commands     also you can say bannedlist to show the banned and adminlist to show the admins!!!

kill/Person299
kills Person299

loopkill/Person299
Repeatedly kills Person299 when he respawns

unloopkill/Person299
Undos loopkill/

heal/Person299
Returns Person299 to full health

damage/Person299/50
Makes Person299's character take 50 damage

health/Person299/999999
Makes Person299's MaxHealth and Health 999999

kick/Person299
Removes Person299 from the game, cannot be used by admin/ed people

ban/Person299
Removes Person299 from the game and keeps him from reenterring, cannot be used by admin/ed people

bannedlist
Shows a list of everyone banned

unban/Person299
Unbans Person299

explode/Person299
Explodes Person299's character

rocket/Person299
Straps a rocket onto Person299's back

removetools/Person299
Removes all of Person299's tools.

givetools/Person299
Gives Person299 all the tools in StarterPack

givebtools/Person299
Gives Person299 the building tools

sit/Person299
Makes Person299 sit

part/4/1/2
Makes a part with the given dimensions appear over your character

respawn/Person299
Makes Person299's character respawn

jail/Person299
Makes a lil jail cell around Person299's character

unjail/Person299
Undos jail/

punish/Person299
Puts Person299's character in game.Lighting

unpunish/Person299
Undos punish/

merge/Person299/Farvei
Makes Person299 control Farvei's character

teleport/Person299/nccvoyager
Teleports Person299's character to nccvoyager's character

control/Person299
Makes you control Person299's character

change/Person299/Money/999999
Makes the Money value in Person299's leaderstats 999999

tools
Gives you a list of all the tools available to be give/en, the tool must be in game.Lighting

give/Person299/Tool
Give's Person299 a tool, the toolname can be abbreviated

time/15.30
Makes game.Lighting.TimeOfDay 15:30

ambient/255/0/0
Makes game.Lighting.Ambient 255,0,0

maxplayers/20
Makes game.Players.MaxPlayers 20

nograv/Person299
Makes Person299 almost weightless

antigrav/Person299
Gives Person299 antigravity properties

grav/Person299
Returns Person299's gravity to normal

highgrav/Person299
Makes Person299 heavier

setgrav/Person299/-196
Sets Person299's gravity

trip/Person299
Makes Person299's character trip

walkspeed/Person299/99
Makes Person299's character's humanoid's WalkSpeed 99, 16 is average

invisible/Person299
Makes Person299's character invisible

visible/Person299
Undos invisible/

freeze/Person299
Makes Person299's character unable to move

thaw/Person299
Undos freeze/

unlock/Person299
Makes Person299's character unlocked

lock/Person299
Makes Person299's character locked

ff/Person299
Gives Person299's character a ForceField

unff/Person299
Undos ff/

sparkles/Person299
Makes Person299's character sparkly

unsparkles/Person299
Undos sparkles/

shield/Person299
Makes a destructive shield thingy appear around Person299

unshield/Person299
Undos shield/

god/Person299
Makes Person299 godish

ungod/Person299
Undos god/

zombify/Person299
Makes Person299 a infecting zombie

admin/Person299
Makes Person299 able to use the command script, cannot be used by admin/ed people

adminlist
Shows a list of everyone in the adminlist

unadmin/Person299
Undos admin/, cannot be used by admin/ed people

shutdown
Shuts the server down, cannot be used by admin/ed people

m/Fallout 2 is one of the best games ever made
Makes a message appear on the screen saying "Fallout 2 is one of the best games ever made" for 2 seconds

h/i like pie
Makes a hint appear on the screen saying "i like pie" for 2 seconds

c/ game.Workspace:remove()
Makes a script which source is whats after c/

clear
Removes all scripts created by c/ and removes all jails.

Capitalisation doesnt matter, and name input can be abbreviated.
Just about any name input can be replaced with multiple names seperated by ","s, me, all, others, guests, admins, nonadmins, random, or team teamname.

--]]



namelist = { }
variablelist = { }
flist = { }

local source = script:FindFirstChild("source")
if source ~= nil then
sbbu = script.source:clone()
sbbu.Disabled = false
else
print("source doesnt exist, your command script may malfunction")
end


tools = Instance.new("Model")
c = game.Lighting:GetChildren()
for i=1,#c do
if c[i].className == "Tool" then
c[i]:clone().Parent = tools
end
if c[i].className == "HopperBin" then
c[i]:clone().Parent = tools
end end

function findplayer(name,speaker)
if string.lower(name) == "all" then
local chars = { }
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
table.insert(chars,c[i])
end end
return chars
elseif string.sub(string.lower(name),1,9) == "nonadmins" then
local nnum = 0
local chars = { }
local c = game.Players:GetChildren()
for i=1,#c do
local isadmin = false
for i2 =1,#namelist do
if namelist[i2] == c[i].Name then
isadmin = true
end end 
if isadmin == false then
nnum = nnum + 1
table.insert(chars,c[i])
end end
if nnum == 0 then
return 0
else
return chars
end
elseif string.sub(string.lower(name),1,6) == "admins" then
local anum = 0
local chars = { }
local c = game.Players:GetChildren()
for i=1,#c do
for i2 =1,#namelist do
if namelist[i2] == c[i].Name then
anum = anum + 1
table.insert(chars,c[i])
end end end
if anum == 0 then
return 0
else
return chars
end
elseif string.sub(string.lower(name),1,6) == "random" then
while true do
local c = game.Players:GetChildren()
local r = math.random(1,#c)
if c[r].className == "Player" then
return { c[r] }
end end
elseif string.sub(string.lower(name),1,6) == "guests" then
local gnum = 0
local chars = { }
local c = game.Players:GetChildren()
for i=1,#c do
if string.sub(c[i].Name,1,5) == "Guest" then
gnum = gnum + 1
table.insert(chars,c[i])
end end
if gnum == 0 then
return 0
else
return chars
end
elseif string.sub(string.lower(name),1,5) == "team " then
local theteam = nil
local tnum = 0
if game.Teams ~= nil then
local c = game.Teams:GetChildren()
for i =1,#c do
if c[i].className == "Team" then
if string.find(string.lower(c[i].Name),string.sub(string.lower(name),6)) == 1 then
theteam = c[i]
tnum = tnum + 1
end end end
if tnum == 1 then
local chars = { }
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
if c[i].TeamColor == theteam.TeamColor then
table.insert(chars,c[i])
end end end
return chars
end end
return 0
elseif string.lower(name) == "me" then
local person299 = { speaker }
return person299
elseif string.lower(name) == "others" then
local chars = { }
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
if c[i] ~= speaker then
table.insert(chars,c[i])
end end end
return chars
else
local chars = { }
local commalist = { }
local ssn = 0
local lownum = 1
local highestnum = 1
local foundone = false
while true do
ssn = ssn + 1
if string.sub(name,ssn,ssn) == "" then
table.insert(commalist,lownum)
table.insert(commalist,ssn - 1)
highestnum = ssn - 1
break
end
if string.sub(name,ssn,ssn) == "," then
foundone = true
table.insert(commalist,lownum)
table.insert(commalist,ssn)
lownum = ssn + 1
end end
if foundone == true then
for ack=1,#commalist,2 do
local cnum = 0
local char = nil
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
if string.find(string.lower(c[i].Name),string.sub(string.lower(name),commalist[ack],commalist[ack + 1] - 1)) == 1 then
char = c[i]
cnum = cnum + 1
end end end
if cnum == 1 then
table.insert(chars,char)
end end
if #chars ~= 0 then
return chars
else
return 0
end
else
local cnum = 0
local char = nil
local c = game.Players:GetChildren()
for i =1,#c do
if c[i].className == "Player" then
if string.find(string.lower(c[i].Name),string.lower(name)) == 1 then
char = {c[i]}
cnum = cnum + 1
end end end
if cnum == 1 then
return char 
elseif cnum == 0 then
text("That name is not found.",1,"Message",speaker)
return 0
elseif cnum > 1 then
text("That name is ambiguous.",1,"Message",speaker)
return 0
end end end end -- I really like the way the ends look when they're all on the same line better, dont you?

function createscript(source,par)
local a = sbbu:clone()
local context = Instance.new("StringValue")
context.Name = "Context"
context.Value = source
context.Parent = a
while context.Value ~= source do wait() end
a.Parent = par
local b = Instance.new("IntValue")
b.Name = "Is A Created Script"
b.Parent = a
end

function text(message,duration,type,object)
local m = Instance.new(type)
m.Text = message
m.Parent = object
wait(duration)
if m.Parent ~= nil then
m:remove()
end end

function foc(msg,speaker)
if string.lower(msg) == "fix" then
for i =1,#namelist do
if namelist[i] == speaker.Name then
variablelist[i]:disconnect()
table.remove(variablelist,i)
table.remove(namelist,i)
table.remove(flist,i)
end end
local tfv = speaker.Chatted:connect(function(msg) oc(msg,speaker) end)
table.insert(namelist,speaker.Name)
table.insert(variablelist,tfv)
local tfv = speaker.Chatted:connect(function(msg) foc(msg,speaker) end)
table.insert(flist,tfv)
end end

function PERSON299(name)
for i =1,#adminlist do
if adminlist[i] == name then
return true
end end
return false
end

function oc(msg,speaker)

if string.sub(string.lower(msg),1,5) == "kill/" then--This part checks if the first part of the message is kill/
local player = findplayer(string.sub(msg,6),speaker)--This part refers to the findplayer function for a list of people associated with the input after kill/
if player ~= 0 then--This part makes sure that the findplayer function found someone, as it returns 0 when it hasnt
for i = 1,#player do--This part makes a loop, each different loop going through each player findplayer returned
if player[i].Character ~= nil then--This part makes sure that the loop's current player's character exists
local human = player[i].Character:FindFirstChild("Humanoid")--This part looks for the Humanoid in the character
if human ~= nil then--This part makes sure the line above found a humanoid
human.Health = 0--This part makes the humanoid's health 0
end end end end end--This line contains the ends for all the if statements and the for loop

if string.sub(string.lower(msg),1,2) == "m/" then
text(speaker.Name .. ": " .. string.sub(msg,3),2,"Message",game.Workspace)
end

if string.sub(string.lower(msg),1,2) == "h/" then
text(speaker.Name .. ": " .. string.sub(msg,3),2,"Hint",game.Workspace)
end

if string.sub(string.lower(msg),1,2) == "c/" then--Dontcha wish pcall was more reliable?
createscript(string.sub(msg,3),game.Workspace)
end

local msg = string.lower(msg)

if string.sub(msg,1,5) == "give/" then
local danumber1 = nil
for i = 6,100 do
if string.sub(msg,i,i) == "/" then
danumber1 = i
break
elseif string.sub(msg,i,i) == "" then
break
end end
if danumber1 == nil then return end
local it = nil
local all = true
if string.sub(string.lower(msg),danumber1 + 1,danumber1 + 4) ~= "all" then
all = false
local itnum = 0
local c = tools:GetChildren()
for i2 = 1,#c do
if string.find(string.lower(c[i2].Name),string.sub(string.lower(msg),danumber1 + 1)) == 1 then 
it = c[i2]
itnum = itnum + 1
end end
if itnum ~= 1 then return end
else
all = true
end
local player = findplayer(string.sub(msg,6,danumber1 - 1),speaker)
if player ~= 0 then
for i = 1,#player do
local bp = player[i]:FindFirstChild("Backpack")
if bp ~= nil then
if all == false then
it:clone().Parent = bp
else
local c = tools:GetChildren()
for i2 = 1,#c do
c[i2]:clone().Parent = bp
end end end end end end