Hmm… I seem to have run into 2 problems I cannot solve myself in the past 5 minutes, lol. Okay, to the point: My problem is, I am firing a RemoteEvent to kick a player from the server, and the event fires to a serverscript, kicking the player.
Server script:
game:GetService("ReplicatedStorage"):WaitForChild("KickEvent").OnServerEvent:Connect(function(kick, reason)
local plrExists = game.Players:FindFirstChild(kick)
if plrExists then
print("Player exists. Kicking...")
plrExists:Kick(reason)
print("Kicked user " ..plrExists.Name .." for reason " ..reason)
end
end)
Script firing the event:
local event = game:GetService("ReplicatedStorage"):WaitForChild("KickEvent")
local rsnBox = script.Parent.Parent.Parent.reason.Front.Input
local usrBox = script.Parent.Parent.Parent.playerName.Front.Input
script.Parent.MouseButton1Click:Connect(function()
local kick = usrBox.Text
local reason = rsnBox.Text
event:FireServer(kick, reason)
end)
I am not getting any errors, but the serverscript is not printing, either.
There’s also the risk of sending a remote event, literally for kicking players.
I didn’t read the script entirely, but I know that remote event of a players name to kick is kind of a bad idea, if you plan on kicking exploiters.
Just checked, it’s just a test to see how kicking works. It’s fine, but an exploiter can abuse this to kick everybody else. Remember: you can’t trust the client.
Yes, I considered this. Is there a way to make it so this is not possible for exploiters? I am thinking maybe to create a script that only inserts the events if a moderator is in-game.
Maybe, but they are capable of Firing the Event numerous times from the client side I believe & messing with everything else in from their view (Aka changing the Gui’s Text)
Well, if they are trying to ban other players, there is already an extra parameter that they need to ban them, and the hacker will not likely wont think about that parameter.