Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SynapseX Decompiler
- local event_kickrequest = game.ReplicatedStorage:WaitForChild("KickRequest")
- local event_update = game.ReplicatedStorage:WaitForChild("UpdateList")
- local event_kick = game.ReplicatedStorage:WaitForChild("KickHost")
- local plr = game.Players.LocalPlayer
- local frame = script.Parent:WaitForChild("Frame")
- local requestframe = script.Parent:WaitForChild("RequestFrame")
- local hostname = ""
- local KickHistory = {}
- local waiting = false
- local host_color = BrickColor.new("Cool yellow")
- local currency_name = "Rep"
- local function UpdateList()
- frame.KickButton.Text = "No host"
- for index, player in ipairs(game.Players:GetChildren()) do
- if player ~= plr and player.TeamColor == host_color then
- if hostname ~= player.Name then
- hostname = player.Name
- waiting = false
- end
- frame.KickButton.Text = "kick"
- end
- end
- end
- function OnClick()
- local name = hostname
- if name ~= "" and plr.leaderstats[currency_name].Value >= 50 and not waiting then
- waiting = true
- event_kickrequest:FireServer(name, "host")
- timer = 600
- frame.KickButton.Text = tostring(timer)
- spawn(function()
- while game.Players:FindFirstChild(name) and wait and timer >= 0 do
- wait(1)
- timer = timer - 1
- frame.KickButton.Text = tostring(timer)
- end
- waiting = false
- UpdateList()
- end)
- end
- end
- frame:WaitForChild("KickButton").MouseButton1Click:connect(function()
- OnClick()
- end)
- event_kickrequest.OnClientEvent:connect(function(name)
- if requestframe.Visible then
- spawn(function()
- while requestframe.Visible and game.Players:FindFirstChild(requestframe.PlayerName.Text) do
- wait(0.5)
- end
- requestframe.PlayerName.Text = name
- requestframe.Visible = true
- end)
- else
- requestframe.PlayerName.Text = name
- requestframe.Visible = true
- end
- end)
- requestframe:WaitForChild("KickButton").MouseButton1Click:connect(function()
- if game.Players:FindFirstChild(requestframe.PlayerName.Text) then
- event_kick:FireServer(requestframe.PlayerName.Text)
- end
- requestframe.Visible = false
- end)
- requestframe:WaitForChild("FreeButton").MouseButton1Click:connect(function()
- requestframe.Visible = false
- end)
- event_update.OnClientEvent:connect(UpdateList)
- UpdateList()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement