Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- video: https://youtu.be/16-1P1uHTWU
- HOW TO MAKE A KICK GUI
- Owner only:
- local open = script.Parent.TextButton -- the opener
- local frame = script.Parent.Frame -- the frame
- local player = game.Players.LocalPlayer -- player (you)
- if player.UserId == 1719872355 then -- if player id = your id (can change your id) then
- open.Visible = true -- opener will visible
- else -- if not
- frame.Visible = false -- both of opener and frame will invisible
- open.Visible = false
- end
- Opener:
- local open = script.Parent -- the opener
- local frame = script.Parent.Parent.Frame -- the kick frame
- local click = script.Parent["UI Click"] -- the sound when you clicked
- open.MouseButton1Click:Connect(function() -- when you clicked the gui
- click:Play() -- the sound will play
- frame.Visible = not frame.Visible -- the kick frame will visible/invisible
- end) -- end of task
- Kick button:
- local kick = script.Parent -- the kick button
- local username = script.Parent.Parent.username -- username box
- local reason = script.Parent.Parent.reason -- reason box
- local click = script.Parent["UI Click"] -- sound
- kick.MouseButton1Click:Connect(function() -- when the kick button got clicked
- click:Play() -- sound will play
- game.ReplicatedStorage.kick:FireServer(username.Text, reason.Text) -- the server will be fire
- end) -- end
- ServerSideService script:
- game.ReplicatedStorage.kick.OnServerEvent:Connect(function(plr, username, reason) -- when the remote event got fired
- local player = game.Players:FindFirstChild(username) -- finding player with username
- if player then -- if found player with username then
- player:Kick(reason) -- kick player with reason
- else -- if not
- return -- return
- end
- end) -- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement