Cheap Admin Commands Script


  • Almost lost the script. lol

    Didn't take too long, but I wanted to make it anyway; it's based around CoderQwerty's Admin GUI.

    Take it to go. ;)

    local Administrators =
    {
    	game.CreatorId;
    	230693565;
    	17514438;
    }
    
    local mfra = script.Parent:WaitForChild('Handler')
    repeat mplyr = script.Parent.Parent.Parent coroutine.yield() until mplyr:IsA('Player')
    local CommandBttns =
    {
    	Target  = mfra:WaitForChild('Target');
    	CmdType = mfra:WaitForChild('Type');
    	Execute = mfra:WaitForChild('Execute');
    }
    
    
    function ChkAdmin(plyr)
    	if #Administrators == 0 then return true end
    	for i, v in pairs(Administrators) do
    		if tonumber(v) and plyr.UserId == tonumber(v) then
    			return true
    		end
    	end
    	return false
    end
    
    if not ChkAdmin(mplyr) then script.Parent:Destroy() end
    
    CommandBttns.Execute.MouseButton1Down:connect(function()
    	local CmdType = CommandBttns.Type.Text:lower()
    	if CmdType == 'ff' or CmdType == 'forcefield' then
    		local plyr = game.Players:FindFirstChild(CommandBttns.Target.Text)
    		if CommandBttns.Target.Text == 'me' then plyr = mplyr end
    		if plyr and plyr:IsA('Player') and plyr.Character then
    			Instance.new('ForceField',plyr.Character).Name='TDC\'S_FF'
    		end
    	elseif CmdType == 'unff' or CmdType == 'unforcefield' then
    		local plyr = game.Players:FindFirstChild(CommandBttns.Target.Text)
    		if CommandBttns.Target.Text == 'me' then plyr = mplyr end
    		if plyr and plyr:IsA('Player') and plyr.Character then
    			for i, v in pairs(plyr.Character) do
    				if v.Name == 'TDC\'S_FF' then
    					v:Destroy()
    				end
    			end
    		end
    	elseif CmdType == 'kill' then
    		local plyr = game.Players:FindFirstChild(CommandBttns.Target.Text)
    		if CommandBttns.Target.Text == 'me' then plyr = mplyr end
    		if plyr and plyr:IsA('Player') then
    			pcall(function() plyr.Character.Humanoid:TakeDamage(plyr.Character.Humanoid.MaxHealth+1) end)
    		end
    	end
    end)
    
    mplyr.Chatted:connect(function(msg)
    	local CmdType = msg:lower()
    	if CmdType == 'ff' or CmdType == 'forcefield' then
    		local plyr = game.Players:FindFirstChild(CommandBttns.Target.Text)
    		if CommandBttns.Target.Text == 'me' then plyr = mplyr end
    		if plyr and plyr:IsA('Player') and plyr.Character then
    			Instance.new('ForceField',plyr.Character).Name='TDC\'S_FF'
    		end
    	elseif CmdType == 'unff' or CmdType == 'unforcefield' then
    		local plyr = game.Players:FindFirstChild(CommandBttns.Target.Text)
    		if CommandBttns.Target.Text == 'me' then plyr = mplyr end
    		if plyr and plyr:IsA('Player') and plyr.Character then
    			for i, v in pairs(plyr.Character) do
    				if v.Name == 'TDC\'S_FF' then
    					v:Destroy()
    				end
    			end
    		end
    	elseif CmdType == 'kill' then
    		local plyr = game.Players:FindFirstChild(CommandBttns.Target.Text)
    		if CommandBttns.Target.Text == 'me' then plyr = mplyr end
    		if plyr and plyr:IsA('Player') then
    			pcall(function() plyr.Character.Humanoid:TakeDamage(plyr.Character.Humanoid.MaxHealth+1) end)
    		end
    	end
    end)
    
    script.Name = string.reverse('tpircS nimdA ekaF s\\'eehT')
    
    

    u no giv credz? u no g3t COOKIZ!!!

    Btw, you guys gotta set up the GUI for it to work. lol

    • Untested. ;)

  • I hate to tell you this, but these admin commands are very poorly made. Modern admin commands are much more efficient, and have cleaner code.


  • @mccrafter1212 What I don't understand is, he seems to be using a RegularScript, but he's using it with a GUI. He should be using remote events with the GUI to send commands typed to the server, and check if the person who's asking to use a command is an admin or not there.


  • I completely agree with you. He should change this to a local script first off, and next he should include remote events (to make it FE-Compatible).


  • @mccrafter1212 Dw, I'm working on a new code. ;)


  • @TheAlphaStigma Cancel that, changed my mind a while ago. :P
    Although I am working on a new system.

Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.