Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local playersFrame = script.Parent:WaitForChild("PlayersFrame")
- local rStorage = game:GetService("ReplicatedStorage")
- local rEvents = rStorage:WaitForChild("RemoteEvents")
- local configs = rStorage:WaitForChild("Configs")
- local interText = script.Parent:WaitForChild("IntermissionText")
- local voteFrame = script.Parent:WaitForChild("VoteFrame")
- local curVote
- rEvents.AddPlayer.OnClientEvent:Connect(function(plr)
- local image = Instance.new("ImageLabel",playersFrame)
- image.Name = plr.UserId
- image.BorderSizePixel = 0
- image.BackgroundTransparency = .65
- image.BackgroundColor3 = Color3.fromRGB(0,0,0)
- image.Image = game.Players:GetUserThumbnailAsync(plr.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)
- end)
- rEvents.RemovePlayer.OnClientEvent:Connect(function(plr)
- local image = playersFrame:FindFirstChild(plr.UserId)
- if image then
- image:Destroy()
- end
- end)
- rEvents.RemoveAllVotes.OnClientEvent:Connect(function()
- for i,v in pairs(voteFrame:GetChildren()) do
- if v.Name == "%Grid%" then
- else
- v:Destroy()
- end
- end
- end)
- rEvents.CreateVote.OnClientEvent:Connect(function(name,imageId)
- local image = Instance.new("ImageButton",voteFrame)
- image.Name = name
- image.BorderSizePixel = 0
- image.BackgroundTransparency = .65
- image.BackgroundColor3 = Color3.fromRGB(0,0,0)
- image.Image = "rbxassetid://"..imageId
- image.MouseButton1Click:Connect(function()
- if curVote == image then
- else
- if curVote == nil then
- else
- rEvents.RemoveVote:FireServer(curVote.Name)
- end
- wait()
- curVote = image
- rEvents.AddVote:FireServer(name)
- end
- end)
- end)
- configs.Status:GetPropertyChangedSignal("Value"):Connect(function()
- interText.Text = configs.Status.Value
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement