Admin Script

  • I decided it would be fun to make an admin script in ROBLOX of my own. I think I did a fair job at making it decently scripted. The admin script saves information, such as admins and banned members. It's super easy to add new commands, as well.

    Here's the link to the model:

    There's a script inside the admin model called information. Here's that script here:

    --// Made by OldPalHappy
    	--// How to use:
    		To use the script, simply type the command "/command" and after typing the name of the command after the /, type the name of the player
    		you wish to use the command on. You can do "me" and "all" as well. You don't have to type their full name, only the first few letters.
    		If you don't want the command to affect you, but you want it to affect everyone else, use allbutme as the target of your command.
    	--// Examples:
    		/kill me
    		/kill all
    		/setjp-80 me
    		/naked allbutme
    	--// Commands:
    		`/kill` ~ Kills the target(s).
    		`/loopkill`, `/startloopkill` ~ Kills the target(s) and keeps killing them when they respawn.
    		`/stoploopkill`, `/endloopkill` ~ Stops loop-killing the target(s).
    		`/explode`, `/boom` ~ Kills target with an explosion.
    		`/naked`, ~ Deletes target's/targets' shirt, pants, and accessories, and makes their body the same color as their head.
    		`/color`, `/paint` ~ Makes the target's/targets' body parts random colors.
    		`/hide`, `/invisible` ~ Makes the target invisible. This command can not be undone unless you reset.
    		`/forcefield`, `/ff` ~ Makes the target(s) require a force field.
    		`/teleportto`, `/tp` ~ Teleports you to target. You can't teleport to yourself or mulitple people.
    		`/teleporttome`, `/bring`, `/tpme` ~ Teleports target(s) to you.
    		`/setjumppower-number`, `/setjp-number` ~ Sets the target's/targets' JumpPower to number.
    		`/setwalkspeed-number`, `/setwp-number` ~ Sets the walkspeed of the target(s).
    		`/giveadmin`, `/admin` ~ Gives the target admin.
    		`/forcejump`, `/jump` ~ Makes target(s) jump.
    		`/backflip` ~ Makes the target(s) do a backflip.
    		`/removelimbs`, `/limbless` ~ Deletets the arms and legs from the target(s).
    		`/meteors`, `meteorshower` ~ Summons a meteor shower onto the target(s).
    		`/freeze`, ~ Stops the target(s) in their tracks, and makes them completely inanimate.
    		`/unfreeze`, `/melt` ~ Undoes the freeze command.
    		`/kick` ~ Removes the target(s) from the game.
    		`/punish` ~ Removes the targets'/target's character from the game.
    		`/forgive`, `/unpunish`, `/respawn` ~ Re-adds the targets'/target's character to the game. If their character is already in workspace, it will respawn them, instantly. 
    		`/spectate`, ``/spec, `/watch` ~ Spectates the target.
    		`/unspectate`, `/unspec` ~ Stops spectating.
    		`/throw`, `/fling` ~ Throws the target in a random direction.
    		`/looklike` ~ Causes the sender to repawn and look like the target.
    		`/playsound-ID`, `/play-ID` ~ Plays the sound with that sound ID for the target(s).
    		`/stopsounds`, `/stop` ~ Stops all sounds created by the admin script for the target(s).
    		`/lag` ~ Causes the target's/targets' clients to set a loop that lags them. People with stonger computers will notice less lag, while people with weaker computers might crash.
    		`/stoplag` ~ Stops lagging target(s). 
    		`/ban` ~ Removes the target(s) from the game and prevents them from coming back. There is a delay with this command, and it might take a minute for the target(s) to be removed.
    		`/d` ~ Makes a randomly sized "D" above someone's head.
    		`/fly` ~ Sends the target(s) into the air.
    		`/fart` ~ Plays a fart sound whenever the target(s) press any button on their keyboard/mouse.
    	--// Settings:
    		Inside the settings folder you will find settings you can enable and disable.
    		`Always Find Player` ~ This settings determines if the script will 'always' find a target. The script will choose the best target
    		based on the information you give it. If this is enabled it will always choose a target. It's recommended that you disable this.
    		`UseIdOnly` ~ If enabled, the script will ignore the names of players and focus only on their IDs. In the admin folder you can
    		set the IDs in the properties of the IntValues. It's recommended that you have this enabled.
    		`DestructibleEnvironment` ~ If enabled, the script is allowed to damage things in workspace. Depending on your needs, you might
    		want to disable this.
    		`Can Kick Self` ~ If enabled, the admins can kick themselfs from the game. It's recommended that you leave this disabled.
    		`Can Ban Self` ~ Basically the same as the CanKickSelf command, but with the ban command. Probably should leave this false.
    	--// Notes:
    		-	This admin script was not made compatable with R15 rig types. Using R15 shouldn't cause the script to error (hopefully), but
    		some of the commands may not work. However, this admin script was made well, and is compatable with Filtering Enabled or without.
    		-	This script uses a DataStore to save data, like admins and such.

    To add your own commands you just have to find the functions module inside the model:
    0_1488696498793_Admin Script Functions Module.PNG

    Inside the script you'll see tons of functions. To make a new command. Just type this after the three long lined comments:

    module.commandname = function(target, sender)

    The command name does have to be all lower case, but when typing the command capitalization doesn't matter.

    The target is a table of the players the admin/super admin is using the command on. The sender is the person saying the command. The sender will have privilege to use the command at this point.

    For example, here's the function for the kick command:

    module.kick = function(target, sender)
    	for _,plr in next, target do

    See how easy it is to add commands? Of course you don't have to add commands because there are already tons of commands added.

    The script also has two types of admins. The super admins and regular admins. Regular admins have a white list of commands they can use in the settings. By default, all commands that can affect others, for the most part, are not included in the white list. Super admins have access to all the commands, and the only way to add super admins is to add it directly into the settings script.

    m["Super Admins"] = {
    	["OldPalHappy"] = 173088939;
    	["Player1"]     = 0;

    Super admins are no saved like regular admins are. To give people regular admin you can either program it in directly or use the command /admin to give admin to someone. There is no way of giving super admin to someone in-game without using the dev-console.

    There's also different types of commands, and the ability to run commands on the client, but I decided not to go over that in this post. Let me know if you would like to know more.

    Also let me know if you use this. I think it's neat, anyways :D

  • @OldPalHappy Well, I recommend a change to the "removelimbs" command:

    You removed the limbs directly, but it only works for R6 grids, you can counter this with for loop, then have it loops through the players' character & check the parts for certain keywords. Here's an example of this:

    for i2, v2 in pairs(Character:GetChildren()) do
    if v2.Name:find('Arm') or v2.Name:find('Leg') then

    That would be a better solution to go about rather than removing the parts directly like in your original code.

    Just a suggestion though. ;)

  • @TheAlphaStigma This project is discontinued, but that's a nice Idea.

  • @OldPalHappy You should make a gui admin command script :P

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