Hey, everyone! I’m currently making a game called “LA World” and I don’t want to have adonis or khols or whatever people use for admin these days.
I’m trying to make my own admin console but I’ve been having some trouble with the kick function. Could someone help me fix my code and allow me to kick people? Thanks!
First of all, you shouldn’t be using a remote to kick players, this makes your game vulnerable to exploiters, second, it errors because you don’t use :WaitForChild(). The script hasn’t finished loading in the GuiObjects therefore they are nil when you attempt to cache them in a variable.
In your local script, you are passing a parameter Player, which is not a valid parameter. The event MouseButton1Click takes in x coordinate, and a y coordinate parameters.
Part of what makes your script not functional is your invalid parameters. You are basically giving a 2D coordinate a property Text, which is not valid. You don’t need any parameters for a MouseButton1Click event in your case. Along with what @JustNode said, it’s also good practice to use :WaitForChild for UI elements because everything in the StarterGui replicates to the client, and this process is not automatic, so your program will run without these UI elements being loaded into the game yet
I set that to nothing, still doesn’t work at all. I also changed the script from local Player = blah to local PunishPlayer = balh but nothing still happens
“PunishPlayer.Text” is not a player, it is a property and therefore it doesn’t have a Name property. It errors because in the script on the server, you’re trying to do PunishPlayer.Text.Name.