I have a gui that kicks a player, but i want to know who kicked the player so i tried using a local script but then i realized i can't kick on local scripts. I know little about remote events. Can anyone help?
Player = game:service'Players'.LocalPlayer
function click()
if script.Parent.Parent.TextBox.Text == "" then
else
local Reason = script.Parent.Parent.KickReason.Text
local Kicked = script.Parent.Parent.TextBox.Text
game.Workspace.Players:FindFirstChild(Kicked):Kick("You have been kicked, for Reason: "..Reason )
print(Kicked.." has been kicked by "..Player" For reason: "..Reason)
end
end
script.Parent.MouseButton1Down:connect(click)

2 comments
Have you tried adding a function, where you must put your name in the GUI? It acts as a safety measure as well as a function..
Yeah I thought of that, but it may not be that secure, for example someone can falsely put someone else name.