Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- You need three things:
- -- 1. A ScreenGui with a TextBox named Username, another TextBox named Reason, and a button named Kick
- -- 2. A RemoteEvent named KickPlayer
- -- 3. 2 Scripts
- -- Add a LocalScript into the gui
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local RemoteEvent = ReplicatedStorage:WaitForChild("KickPlayer") -- Change it to the name of the remote event
- local button = script.Parent.Kick
- local player = script.Parent.Username.Text
- local reason = script.Parent.Reason.Text
- button.MouseButton1Click:Connect(function()
- if game.Players:FindFirstChild(player) then
- RemoteEvent:FireServer(player, reason)
- end
- end)
- -- Server Script
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local RemoteEvent = ReplicatedStorage:WaitForChild("KickPlayer") -- Change it to the name of the remote event
- RemoteEvent.OnServerEvent:Connect(function(player, username, reason)
- game.Players:FindFirstChild(username):Kick("\nYou were kicked for\n"..reason.."\n")
- end)
Add Comment
Please, Sign In to add comment