Hi there. Im in needing some help scripting a basic admin plugin.
I dont really know how to script, i know some things but its all beginner stuff.
Im trying to script a command so that I can temporarily change a players overhead GUI to what ever the admin inputs. For example, :role exquicvs test
and it would change the section in my overhead rank gui to “test” instead of my group rank “president”
If someone could help me script this, heres my current code, its really just a refined version of the plugin example, but its a start i guess?
local Plugin = function(...)
local Data = {...}
-- Included Functions and Info --
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local Prefix = Data[1][5]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
local cleanData = Data[1][8] -- cleanData(Sender,Receiver,Data)
-- Practical example, for a gui specifically for a player, from another player
-- cleanData(Sender,Receiver,"hi") -- You need receiver because it's being sent to everyone
-- Or for a broadcast (something everyone sees, from one person, to nobody specific)
-- cleanData(Sender,nil,"hi") -- Receiver is nil because it is a broadcast
-- Plugin Configuration --
local pluginName = 'role'
local pluginPrefix = Prefix
local pluginLevel = 2
local pluginUsage = "<User(s)> <Role>" -- leave blank if the command has no arguments
local pluginDescription = "Change a players role"
-- Example Plugin Function --
local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
local Player = Args[1]
if Args[3] then
local Victims = returnPlayers(Player, Args[3]) if not Victims then return end
local combinedVictims = ''
for a,b in pairs(Victims) do
if combinedVictims == '' then
combinedVictims = b.Name
else
combinedVictims = combinedVictims..', '..b.Name
end
end
for a,b in next,Victims do
remoteEvent:FireClient(b,'Hint','Aauvi Administration','Secuessfully changed the specified players role.',{'Message','Results',combinedVictims})
end
end
end
-- Return Everything to the MainModule --
local descToReturn
if pluginUsage ~= "" then
descToReturn = pluginPrefix..pluginName..' '..pluginUsage..'\n'..pluginDescription
else
descToReturn = pluginPrefix..pluginName..'\n'..pluginDescription
end
return pluginName,pluginFunction,pluginLevel,pluginPrefix,{pluginName,pluginUsage,pluginDescription}
end
return Plugin
i created the message part where it tells u like it secuessfully did it, although i need help with the part that actually changes the role
thanks