Advertisement
Guest User

Kick GUI script

a guest
Sep 30th, 2022
7,719
3
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 4 1
  1. video: https://youtu.be/16-1P1uHTWU
  2.  
  3. HOW TO MAKE A KICK GUI
  4.  
  5. Owner only:
  6. local open = script.Parent.TextButton -- the opener
  7. local frame = script.Parent.Frame -- the frame
  8. local player = game.Players.LocalPlayer -- player (you)
  9.  
  10. if player.UserId == 1719872355 then -- if player id = your id (can change your id) then
  11. open.Visible = true -- opener will visible
  12. else -- if not
  13. frame.Visible = false -- both of opener and frame will invisible
  14. open.Visible = false
  15. end
  16.  
  17. Opener:
  18. local open = script.Parent -- the opener
  19. local frame = script.Parent.Parent.Frame -- the kick frame
  20. local click = script.Parent["UI Click"] -- the sound when you clicked
  21.  
  22. open.MouseButton1Click:Connect(function() -- when you clicked the gui
  23. click:Play() -- the sound will play
  24. frame.Visible = not frame.Visible -- the kick frame will visible/invisible
  25. end) -- end of task
  26.  
  27. Kick button:
  28. local kick = script.Parent -- the kick button
  29. local username = script.Parent.Parent.username -- username box
  30. local reason = script.Parent.Parent.reason -- reason box
  31. local click = script.Parent["UI Click"] -- sound
  32.  
  33. kick.MouseButton1Click:Connect(function() -- when the kick button got clicked
  34. click:Play() -- sound will play
  35. game.ReplicatedStorage.kick:FireServer(username.Text, reason.Text) -- the server will be fire
  36. end) -- end
  37.  
  38. ServerSideService script:
  39. game.ReplicatedStorage.kick.OnServerEvent:Connect(function(plr, username, reason) -- when the remote event got fired
  40. local player = game.Players:FindFirstChild(username) -- finding player with username
  41. if player then -- if found player with username then
  42. player:Kick(reason) -- kick player with reason
  43. else -- if not
  44. return -- return
  45. end
  46. end) -- end
Tags: Kick GUI
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement