Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. --SynapseX Decompiler
  2.  
  3. local event_kickrequest = game.ReplicatedStorage:WaitForChild("KickRequest")
  4. local event_update = game.ReplicatedStorage:WaitForChild("UpdateList")
  5. local event_kick = game.ReplicatedStorage:WaitForChild("KickHost")
  6. local plr = game.Players.LocalPlayer
  7. local frame = script.Parent:WaitForChild("Frame")
  8. local requestframe = script.Parent:WaitForChild("RequestFrame")
  9. local hostname = ""
  10. local KickHistory = {}
  11. local waiting = false
  12. local host_color = BrickColor.new("Cool yellow")
  13. local currency_name = "Rep"
  14. local function UpdateList()
  15. frame.KickButton.Text = "No host"
  16. for index, player in ipairs(game.Players:GetChildren()) do
  17. if player ~= plr and player.TeamColor == host_color then
  18. if hostname ~= player.Name then
  19. hostname = player.Name
  20. waiting = false
  21. end
  22. frame.KickButton.Text = "kick"
  23. end
  24. end
  25. end
  26. function OnClick()
  27. local name = hostname
  28. if name ~= "" and plr.leaderstats[currency_name].Value >= 50 and not waiting then
  29. waiting = true
  30. event_kickrequest:FireServer(name, "host")
  31. timer = 600
  32. frame.KickButton.Text = tostring(timer)
  33. spawn(function()
  34. while game.Players:FindFirstChild(name) and wait and timer >= 0 do
  35. wait(1)
  36. timer = timer - 1
  37. frame.KickButton.Text = tostring(timer)
  38. end
  39. waiting = false
  40. UpdateList()
  41. end)
  42. end
  43. end
  44. frame:WaitForChild("KickButton").MouseButton1Click:connect(function()
  45. OnClick()
  46. end)
  47. event_kickrequest.OnClientEvent:connect(function(name)
  48. if requestframe.Visible then
  49. spawn(function()
  50. while requestframe.Visible and game.Players:FindFirstChild(requestframe.PlayerName.Text) do
  51. wait(0.5)
  52. end
  53. requestframe.PlayerName.Text = name
  54. requestframe.Visible = true
  55. end)
  56. else
  57. requestframe.PlayerName.Text = name
  58. requestframe.Visible = true
  59. end
  60. end)
  61. requestframe:WaitForChild("KickButton").MouseButton1Click:connect(function()
  62. if game.Players:FindFirstChild(requestframe.PlayerName.Text) then
  63. event_kick:FireServer(requestframe.PlayerName.Text)
  64. end
  65. requestframe.Visible = false
  66. end)
  67. requestframe:WaitForChild("FreeButton").MouseButton1Click:connect(function()
  68. requestframe.Visible = false
  69. end)
  70. event_update.OnClientEvent:connect(UpdateList)
  71. UpdateList()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement