Hey there! I am trying to make a custom admin GUI for a game of mine. I have all the GUI made(It is very basic and it is currently just the testing version) and I have it set to where you type the player name in a designated box, select the command and then press a button that says “Execute” on it.
When the player clicks the “Execute” button this is the code that runs in a LocalScript in the button. (Sorry it isn’t colored, I can’t figure out how it’s being a bit dumb.)
Button.MouseButton1Click:Connect(function()
ExecuteCommand:FireServer(Button.Parent.PlayerNameBox.Text, Button.Parent.Command.Value)
print(Button.Parent.PlayerNameBox.Text)
print(Button.Parent.Command.Value)
end)
And this is the code on the ServerScript.
local executeevent = game.ReplicatedStorage.ExecuteAdmin
local function ExecuteCommand(Player, Command)
print("Execute sent")
print(Player)
print(Command)
if Command == "Kick" then
game.Players[Player]:Kick("You have been kicked from the game.")
end
end
endexecuteevent.OnServerEvent:Connect(ExecuteCommand)
This is what gets printed when it happens.
As you can see, in the local script, it prints the right player name and command, but then when it goes to the server both of the values are the same.
I have absolutely no idea how to fix this, I’ve never ran into this issue before. Thanks so much!