Hello, I've been programming a simple kick GUI, so when you click 'Kick' it'll get the players name from a text box in the GUI and the reason of the kick, but it doesn't kick me when I test it.
The script is a Local Script not server side.
Here it is:
-- // Script Written by: DevCadenator
-- // Script title: Basic Kick Script, 29/10/2018 (DD/MM/YY)
-- // Notice: None
script.Parent.MouseButton1Click:Connect(function()-- When the player clicks on the button it will run the function below.
-- Varibles --
local player = game.Players:FindFirstChild(script.Parent.Parent.KickValue.Text) -- The player to kick.
local reason = script.Parent.Parent.KickValue2.Text -- The reason that the Admin entered.
-- Primary Script --
if player == nil then -- Checks if the player doesn't exist.
warn("Player - " .. script.Parent.Parent.KickValue.Text " does not exist!") -- Sends a warning to the console that the player doesn't exist.
else -- If the player exists then the code will continue below, else it will stop.
if reason == "Reason" then -- Checks if the Admin didn't write a reason.
print("No reason provided for " .. player.Name .. " kick.") -- Prints to console saying that there is no reason provided for the kick.
player:Kick("No reason provided") -- Kicks the player with the text saying "No reason provided"
else -- If the reason isn't blank then it will continue to run the code below.
print("Checking permission level to kick " .. player.Name .. " for " .. reason) -- Prints to the console that administrator.
wait(0.1) -- Puts a wait time in-between when a string is printed to console and when the player is kicked.
player:Kick(reason) -- Kicks the player for the reason.
print(player.Name .. " has been kicked for: " .. reason) -- Prints to console that a player has been kicked and for what reason.
-- End of Script --
end
end
end) -- This will end the function.
--- Script created for - The Queens Hotel ---
Any help would be greatly appreciated.
Caden

3 comments
Could you get rid of all those comments LOL
^ comments are helpful wym
But over-commenting code is a code smell