generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: just realized how bad kohl's admin is

Previous Thread :: Next Thread 
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2016 06:13 PM
oh dear god...


if msg:lower():sub(1,3) == "pm " then
local chk1 = msg:lower():sub(4):find(" ") + 3
local plrz = GetPlr(plr, msg:lower():sub(4,chk1-1))
Message("Private Message from " .. plr.Name, msg:sub(chk1+1), true, plrz)
end

if msg:lower():sub(1,11) == "resetstats " then
local plrz = GetPlr(plr, msg:lower():sub(12))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
if v and v:findFirstChild("leaderstats") then
for a, q in pairs(v.leaderstats:children()) do
if q:IsA("IntValue") then q.Value = 0 end
end
end
end))
end
end


- Isosta
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
08 Jul 2016 06:31 PM
I thought it used tables. Lel.
Report Abuse
MKofOrbiter is not online. MKofOrbiter
Joined: 28 Aug 2010
Total Posts: 910
08 Jul 2016 06:31 PM
Look at the date when it was created.


Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2016 06:35 PM
i assumed it would do something along the lines of this:

local functionSet = {
['Kill'] = {
['Alias'] = {
'Kill',
'Murder',
'Annihilate'
}
['Function'] = function(RecievedArgument)
--stuff
end
}
}

for i,v in next, functionSet do
for _,Alias in ipairs(v.Alias) do
if Alias:lower() == FunctionToFire:lower() then
v.Function('SentArgument')
break
end
end
end


that might not work, dont kill me


- Isosta
Report Abuse
GGGGG14 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
08 Jul 2016 06:36 PM
My admin commands are better :P (like most people)
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2016 06:37 PM
@ggggg,

same

i never bothered to complete or opensource mine though, so.


- Isosta
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
08 Jul 2016 06:39 PM
Or I mean you could do something like this :3.

if Commmands[cmd] then
Commands[cmd](Arguments);
end;

A for loop would have to iterate through thousands of commands assuming if you had thousands of commands.
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2016 06:40 PM
multiple alias'


- Isosta
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
08 Jul 2016 06:41 PM
assuming*** not if assuming.

Also for aliases just declare the variable outside of the table and point the aliases to the variable :3.
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
08 Jul 2016 06:42 PM
local Commands = {
["kill"] = KillCommand;
["kill2"] = KillCommand;
["kill3"] = KillCommand;
};
Report Abuse
GGGGG14 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
08 Jul 2016 06:44 PM
I have a user interface admin commands that I shared on developer's forum online...

It uses RemoteEvents and RemoteFunctions to safely pass arguments to the server and there it checks if you're an administrator w/ server variables...

It also has a built in administrator hierarchy so only certain admins can actually use commands on certain others...

But the code goes like this:

local ProcessCommand = function(Player,SelectedCommand,PlayerList)

if CheckTable(Owners,Player.Name) then
Commands[SelectedCommand](Player,PlayerList)

elseif CheckTable(Admins,Player.Name) then
if SelectedCommand ~= "kick" and SelectedCommand ~= "ban" and SelectedCommand ~= "pban" then
Commands[SelectedCommand](Player,PlayerList)
else
Commands[SelectedCommand](Player,AdjustPlayerListForAdminLevel(PlayerList))
NotifyPlayerEvent:FireClient(Player,"System Notification","ERROR: You cannot "..SelectedCommand.." another admin. All other selected players were still "..SelectedCommand.."'d though.",60)
end
end
end

ProcessCommandEvent.OnServerEvent:connect(ProcessCommand)
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
08 Jul 2016 06:48 PM
I usually don't share my coding ways.

But why remote_event's to pass variables from client to server.

.Chatted can be ran server sided, and if you needed to run something locally you could use RemoteEvent:FireClient();
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2016 06:51 PM
@secret,

FireClient still requires a remote event.


- Isosta
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
08 Jul 2016 06:58 PM
Yeah but he's passing from client to server.

I see now, you have a command bar now right? Not just using chat.
Or custom-chat. Yeah that would be useful and necessary in that scenario.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image