I’m making a Ban system but something is not working I don’t know how to fix it.
I know that I can’t kick a non-local Player from a local script but I already tried to pass the local script to a script but isn’t working.
The Script:
Please help me!!
regexman
(reg)
December 4, 2021, 7:46pm
#2
What’s the script? We can’t help you without it
So use local player = game.Players.LocalPlayer
.
regexman
(reg)
December 4, 2021, 7:52pm
#6
You can’t kick from local, so you need to learn RemoteEvent to communicate thru client to server.
Ok I’ll read about it thx for answer
regexman
(reg)
December 4, 2021, 7:56pm
#8
Here’s example code (you need to edit it)
--localscript
button.MouseButton1Click:Connect(function()
remoteevent:FireServer(textbox.Text)
end)
--Server
remoteevent.OnServerEvent:Connect(function(plr,plrtokick)
game.Players:FindFirstChild(plrtokick):Kick("kicked")
end)
1 Like
Don’t use this, please, if you do at least add some sort of sanity checks to make sure the player is an administrator and or has privilege’s to execute your ‘command’;
if plr.UserId == 0 then
// Run code
end
Don’t worry only Me can use The ban system.