It returned an instance. Also wdym the loop?
The loops you have in your 2 statements, try this out
local server = require(game.ServerScriptService.Main.Server)
function Funcs.Promote(Args)
local Player = Args[1]
local Command = Args[2]
local Players = returnPlayers(Player,Args[3],Args[2]) if not Players then return end
if Command == "promote" then
server.Promote(9832442,Player.UserId)
essentialsEvent:FireAllClients('Hint','Success','Promoted user '..Player.Name.."!")
elseif Command == "demote" then
server.Demote(9832442,Player.UserId)
essentialsEvent:FireAllClients('Hint','Success','Demoted user '..Player.Name.."!")
end
end
Iām not sure why you were promoting/demoting for each time you go through the players when you can just promote/demote once and show the hint using FireAllClients
Ok.
ehfshefusedhfshjfhjsefhjkesafhjwejhfewhfehjiswthji4ewiut43uiw
But would using fireallclients show the hint to everyone?
Wait my mistake I didnāt see the first argument correctly, I thought you were wanting to show it to everyone, use this
local server = require(game.ServerScriptService.Main.Server)
function Funcs.Promote(Args)
local Player = Args[1]
local Command = Args[2]
local Players = returnPlayers(Player,Args[3],Args[2]) if not Players then return end
if Command == "promote" then
server.Promote(9832442,Player.UserId)
essentialsEvent:FireClient(Player,'Hint','Success','Promoted user '..Player.Name.."!")
elseif Command == "demote" then
server.Demote(9832442,Player.UserId)
essentialsEvent:FireClient(Player,'Hint','Success','Demoted user '..Player.Name.."!")
end
end
But if you want to show ti to everyone, use previous method
Ok!
sdfjdsfjdslkjfdlsjfksfjeskfjeiasfjiesfjklsdfjklsfk
Done.
fdjksfjlsfjklsefkjlewfjeklwfjeklsfjdslkfjdklsfkjlsdfksgsgs
Does it work now or are there still issues?
There is still issues getting the player userID
Okay something is wrong with that instance, do print(Player.ClassName)
, also did you mean to do local Player = Args[1]
instead of local Player = Args[3]
by any chance?
Ok.
fjdhsfhslkfjklsejgfowefjgewgergregewg
???
Iām unsure about that bit cause I see you use Args[3]
in the Players variable line, but if itās wrong you can just ignore that, what did it print for the ClassName?
Player.
sfhsdufghsuigfuisdfgeshfgehsjghfuiehgjwejgwehuiewhguiewhiugwhuieghuiewghwegw
Okay so we confirmed itās a player instance, but Iām still confused as to why it didnāt print the userid. How are you executing the command?
Command line.
sejfesfjhweshjkgfshjkfhjksdhfjgsejhkfs
What are you inputting into it?
The BAE console
dfjsajefsjhefjhsdfjkdsjkfsjdfjkhdshjkfsdf
Maybe try this?
local server = require(game.ServerScriptService.Main.Server)
function Funcs.Promote(Args)
local Player = Args[1]
local Command = Args[2]
if Command == "promote" then
server.Promote(9832442,Player.UserId)
essentialsEvent:FireClient(Player,'Hint','Success','Promoted user '..Player.Name.."!")
elseif Command == "demote" then
server.Demote(9832442,Player.UserId)
essentialsEvent:FireClient(Player,'Hint','Success','Demoted user '..Player.Name.."!")
end
end
If it doesnāt work either, something else is causing it
It did not give me any errors, but it said Promote User phyouthcenter1 when I ran it on someone else. Also, it didnāt promote them.