Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- GUIS:
- -- Vote results
- local VoteResults = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local Top = Instance.new("TextLabel")
- local TextButton = Instance.new("TextButton")
- local Question = Instance.new("TextLabel")
- local AnswerGreen = Instance.new("Frame")
- local AnswerName = Instance.new("TextLabel")
- local AnswerAmount = Instance.new("TextLabel")
- local AnswerGrey = Instance.new("Frame")
- local AnswerName_2 = Instance.new("TextLabel")
- local AnswerAmount_2 = Instance.new("TextLabel")
- local AnswerRed = Instance.new("Frame")
- local AnswerName_3 = Instance.new("TextLabel")
- local AnswerAmount_3 = Instance.new("TextLabel")
- -- Properties
- VoteResults.Name = "Vote Results"
- VoteResults.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame.Parent = VoteResults
- Frame.AnchorPoint = Vector2.new(0.5, 0.5)
- Frame.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame.BackgroundTransparency = 0.5
- Frame.Position = UDim2.new(0.5, 0, -0.25, 0)
- Frame.Size = UDim2.new(0.400000006, 0, 0.400000006, 0)
- Top.Name = "Top"
- Top.Parent = Frame
- Top.BackgroundColor3 = Color3.new(0, 0, 0)
- Top.BackgroundTransparency = 0.5
- Top.Size = UDim2.new(1, 0, 0.0799999982, 0)
- Top.Font = Enum.Font.SourceSans
- Top.Text = "Poll results"
- Top.TextColor3 = Color3.new(1, 1, 1)
- Top.TextScaled = true
- Top.TextSize = 14
- Top.TextWrapped = true
- Top.TextXAlignment = Enum.TextXAlignment.Left
- TextButton.Parent = Top
- TextButton.AnchorPoint = Vector2.new(1, 0)
- TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton.BackgroundTransparency = 1
- TextButton.Position = UDim2.new(1, 0, 0, 0)
- TextButton.Size = UDim2.new(1, 0, 1, 0)
- TextButton.SizeConstraint = Enum.SizeConstraint.RelativeYY
- TextButton.Font = Enum.Font.SourceSans
- TextButton.Text = "X"
- TextButton.TextColor3 = Color3.new(1, 1, 1)
- TextButton.TextScaled = true
- TextButton.TextSize = 14
- TextButton.TextWrapped = true
- Question.Name = "Question"
- Question.Parent = Frame
- Question.BackgroundColor3 = Color3.new(1, 1, 1)
- Question.BackgroundTransparency = 0.80000001192093
- Question.Position = UDim2.new(0, 0, 0.0799999982, 0)
- Question.Size = UDim2.new(1, 0, 0.319999993, 0)
- Question.Font = Enum.Font.SourceSans
- Question.Text = "Question: Should I respawn every player?"
- Question.TextColor3 = Color3.new(1, 1, 1)
- Question.TextScaled = true
- Question.TextSize = 14
- Question.TextWrapped = true
- Question.TextXAlignment = Enum.TextXAlignment.Left
- Question.TextYAlignment = Enum.TextYAlignment.Top
- AnswerGreen.Name = "AnswerGreen"
- AnswerGreen.Parent = Frame
- AnswerGreen.BackgroundColor3 = Color3.new(0.00392157, 0.364706, 0)
- AnswerGreen.BackgroundTransparency = 0.5
- AnswerGreen.BorderSizePixel = 0
- AnswerGreen.Position = UDim2.new(0.100000001, 0, 0.5, 0)
- AnswerGreen.Size = UDim2.new(0.25, 0, 0.400000006, 0)
- AnswerName.Name = "AnswerName"
- AnswerName.Parent = AnswerGreen
- AnswerName.AnchorPoint = Vector2.new(0, 1)
- AnswerName.BackgroundColor3 = Color3.new(0, 0, 0)
- AnswerName.BackgroundTransparency = 0.80000001192093
- AnswerName.Position = UDim2.new(0, 0, 1, 0)
- AnswerName.Size = UDim2.new(1, 0, 0.5, 0)
- AnswerName.Font = Enum.Font.SourceSans
- AnswerName.Text = "Yes"
- AnswerName.TextColor3 = Color3.new(0, 1, 0.0313726)
- AnswerName.TextScaled = true
- AnswerName.TextSize = 14
- AnswerName.TextWrapped = true
- AnswerName.TextYAlignment = Enum.TextYAlignment.Top
- AnswerAmount.Name = "AnswerAmount"
- AnswerAmount.Parent = AnswerGreen
- AnswerAmount.BackgroundColor3 = Color3.new(0, 0, 0)
- AnswerAmount.BackgroundTransparency = 1
- AnswerAmount.Size = UDim2.new(1, 0, 0.5, 0)
- AnswerAmount.Font = Enum.Font.SourceSans
- AnswerAmount.Text = "5"
- AnswerAmount.TextColor3 = Color3.new(1, 1, 1)
- AnswerAmount.TextScaled = true
- AnswerAmount.TextSize = 14
- AnswerAmount.TextWrapped = true
- AnswerAmount.TextYAlignment = Enum.TextYAlignment.Top
- AnswerGrey.Name = "AnswerGrey"
- AnswerGrey.Parent = Frame
- AnswerGrey.AnchorPoint = Vector2.new(0.5, 0)
- AnswerGrey.BackgroundColor3 = Color3.new(0.364706, 0.364706, 0.364706)
- AnswerGrey.BackgroundTransparency = 0.5
- AnswerGrey.BorderSizePixel = 0
- AnswerGrey.Position = UDim2.new(0.5, 0, 0.5, 0)
- AnswerGrey.Size = UDim2.new(0.25, 0, 0.400000006, 0)
- AnswerName_2.Name = "AnswerName"
- AnswerName_2.Parent = AnswerGrey
- AnswerName_2.AnchorPoint = Vector2.new(0, 1)
- AnswerName_2.BackgroundColor3 = Color3.new(0, 0, 0)
- AnswerName_2.BackgroundTransparency = 0.80000001192093
- AnswerName_2.Position = UDim2.new(0, 0, 1, 0)
- AnswerName_2.Size = UDim2.new(1, 0, 0.5, 0)
- AnswerName_2.Font = Enum.Font.SourceSans
- AnswerName_2.Text = "NoA"
- AnswerName_2.TextColor3 = Color3.new(1, 1, 1)
- AnswerName_2.TextScaled = true
- AnswerName_2.TextSize = 14
- AnswerName_2.TextWrapped = true
- AnswerName_2.TextYAlignment = Enum.TextYAlignment.Top
- AnswerAmount_2.Name = "AnswerAmount"
- AnswerAmount_2.Parent = AnswerGrey
- AnswerAmount_2.BackgroundColor3 = Color3.new(0, 0, 0)
- AnswerAmount_2.BackgroundTransparency = 1
- AnswerAmount_2.Size = UDim2.new(1, 0, 0.5, 0)
- AnswerAmount_2.Font = Enum.Font.SourceSans
- AnswerAmount_2.Text = "5"
- AnswerAmount_2.TextColor3 = Color3.new(1, 1, 1)
- AnswerAmount_2.TextScaled = true
- AnswerAmount_2.TextSize = 14
- AnswerAmount_2.TextWrapped = true
- AnswerAmount_2.TextYAlignment = Enum.TextYAlignment.Top
- AnswerRed.Name = "AnswerRed"
- AnswerRed.Parent = Frame
- AnswerRed.AnchorPoint = Vector2.new(1, 0)
- AnswerRed.BackgroundColor3 = Color3.new(0.364706, 0, 0)
- AnswerRed.BackgroundTransparency = 0.5
- AnswerRed.BorderSizePixel = 0
- AnswerRed.Position = UDim2.new(0.899999976, 0, 0.5, 0)
- AnswerRed.Size = UDim2.new(0.25, 0, 0.400000006, 0)
- AnswerName_3.Name = "AnswerName"
- AnswerName_3.Parent = AnswerRed
- AnswerName_3.AnchorPoint = Vector2.new(0, 1)
- AnswerName_3.BackgroundColor3 = Color3.new(0, 0, 0)
- AnswerName_3.BackgroundTransparency = 0.80000001192093
- AnswerName_3.Position = UDim2.new(0, 0, 1, 0)
- AnswerName_3.Size = UDim2.new(1, 0, 0.5, 0)
- AnswerName_3.Font = Enum.Font.SourceSans
- AnswerName_3.Text = "N/A"
- AnswerName_3.TextColor3 = Color3.new(1, 0, 0)
- AnswerName_3.TextScaled = true
- AnswerName_3.TextSize = 14
- AnswerName_3.TextWrapped = true
- AnswerName_3.TextYAlignment = Enum.TextYAlignment.Top
- AnswerAmount_3.Name = "AnswerAmount"
- AnswerAmount_3.Parent = AnswerRed
- AnswerAmount_3.BackgroundColor3 = Color3.new(0, 0, 0)
- AnswerAmount_3.BackgroundTransparency = 1
- AnswerAmount_3.Size = UDim2.new(1, 0, 0.5, 0)
- AnswerAmount_3.Font = Enum.Font.SourceSans
- AnswerAmount_3.Text = "5"
- AnswerAmount_3.TextColor3 = Color3.new(1, 1, 1)
- AnswerAmount_3.TextScaled = true
- AnswerAmount_3.TextSize = 14
- AnswerAmount_3.TextWrapped = true
- AnswerAmount_3.TextYAlignment = Enum.TextYAlignment.Top
- -- Vote
- local Vote = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local Question = Instance.new("TextLabel")
- local Yes = Instance.new("TextButton")
- local No = Instance.new("TextButton")
- local Time = Instance.new("TextLabel")
- local Top = Instance.new("TextLabel")
- local TextButton = Instance.new("TextButton")
- -- Properties
- Vote.Name = "Vote"
- Vote.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame.Parent = Vote
- Frame.AnchorPoint = Vector2.new(1, 1)
- Frame.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame.BackgroundTransparency = 0.5
- Frame.Position = UDim2.new(1.35, -10, 1, -10)
- Frame.Size = UDim2.new(0.2, 0, 0.12, 0)
- Question.Name = "Question"
- Question.Parent = Frame
- Question.BackgroundColor3 = Color3.new(1, 1, 1)
- Question.BackgroundTransparency = 1
- Question.Position = UDim2.new(0, 0, 0.150000006, 0)
- Question.Size = UDim2.new(1, 0, 0.550000012, 0)
- Question.Font = Enum.Font.SourceSans
- Question.Text = "Should I respawn every player?"
- Question.TextColor3 = Color3.new(1, 1, 1)
- Question.TextScaled = true
- Question.TextSize = 14
- Question.TextWrapped = true
- Yes.Name = "Yes"
- Yes.Parent = Frame
- Yes.AnchorPoint = Vector2.new(1, 0.5)
- Yes.BackgroundColor3 = Color3.new(0, 0.8, 0.0666667)
- Yes.BorderSizePixel = 0
- Yes.Position = UDim2.new(0.449999988, 0, 0.850000024, 0)
- Yes.Size = UDim2.new(0.300000012, 0, 0.200000003, 0)
- Yes.Font = Enum.Font.SourceSans
- Yes.Text = "Yes"
- Yes.TextColor3 = Color3.new(1, 1, 1)
- Yes.TextScaled = true
- Yes.TextSize = 14
- Yes.TextWrapped = true
- No.Name = "No"
- No.Parent = Frame
- No.AnchorPoint = Vector2.new(0, 0.5)
- No.BackgroundColor3 = Color3.new(0.8, 0, 0.0117647)
- No.BorderSizePixel = 0
- No.Position = UDim2.new(0.550000012, 0, 0.850000024, 0)
- No.Size = UDim2.new(0.300000012, 0, 0.200000003, 0)
- No.Font = Enum.Font.SourceSans
- No.Text = "No"
- No.TextColor3 = Color3.new(1, 1, 1)
- No.TextScaled = true
- No.TextSize = 14
- No.TextWrapped = true
- Time.Name = "Time"
- Time.Parent = Frame
- Time.AnchorPoint = Vector2.new(1, 1)
- Time.BackgroundColor3 = Color3.new(1, 1, 1)
- Time.BackgroundTransparency = 1
- Time.Position = UDim2.new(1, 0, 1, -2)
- Time.Size = UDim2.new(0.25, 0, 0.25, 0)
- Time.SizeConstraint = Enum.SizeConstraint.RelativeYY
- Time.Font = Enum.Font.SourceSans
- Time.Text = "10"
- Time.TextColor3 = Color3.new(1, 1, 1)
- Time.TextScaled = true
- Time.TextSize = 14
- Time.TextWrapped = true
- Top.Name = "Top"
- Top.Parent = Frame
- Top.BackgroundColor3 = Color3.new(0, 0, 0)
- Top.BackgroundTransparency = 0.5
- Top.Size = UDim2.new(1, 0, 0.150000006, 0)
- Top.Font = Enum.Font.SourceSans
- Top.Text = "Asked by: Memo1332"
- Top.TextColor3 = Color3.new(1, 1, 1)
- Top.TextScaled = true
- Top.TextSize = 14
- Top.TextWrapped = true
- Top.TextXAlignment = Enum.TextXAlignment.Left
- TextButton.Parent = Top
- TextButton.AnchorPoint = Vector2.new(1, 0)
- TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton.BackgroundTransparency = 1
- TextButton.Position = UDim2.new(1, 0, 0, 0)
- TextButton.Size = UDim2.new(1, 0, 1, 0)
- TextButton.SizeConstraint = Enum.SizeConstraint.RelativeYY
- TextButton.Font = Enum.Font.SourceSans
- TextButton.Text = "X"
- TextButton.TextColor3 = Color3.new(1, 1, 1)
- TextButton.TextScaled = true
- TextButton.TextSize = 14
- TextButton.TextWrapped = true
- -- Scripts
- local player = game.Players.Memo1332
- local poll = false
- player.Chatted:Connect(function(msg)
- if msg:sub(1,6):lower() == ";poll/" then
- if poll == false then
- poll = true
- local whoans1 = {}
- local whoans2 = {}
- local whona = {}
- local arg = string.split(msg:sub(7),"/")
- local ans1 = 0
- local ans2 = 0
- local na = 0
- local plrs = #game.Players:GetChildren()
- for i,v in pairs(game.Players:GetChildren()) do
- if v.Name == "Memo1332" then
- local clon = Vote:Clone()
- clon.Parent = v.PlayerGui
- clon.Frame.Question.Text = arg[1]
- clon.Frame.Top.Text = "Asked by: "..player.Name
- clon.Frame.Yes.Text = arg[2]
- clon.Frame.No.Text = arg[3]
- print(arg[1],arg[2],arg[3])
- clon.Frame:TweenPosition(UDim2.new(1,-10,1,-10),Enum.EasingDirection.Out,Enum.EasingStyle.Back,0.5,true)
- coroutine.resume(coroutine.create(function()
- for i=1,3 do
- if clon ~= nil and clon:FindFirstChild("Frame") ~= nil then
- clon.Frame.BackgroundColor3 = Color3.fromRGB(255,0,0)
- end
- wait(.3)
- if clon ~= nil and clon:FindFirstChild("Frame") ~= nil then
- clon.Frame.BackgroundColor3 = Color3.fromRGB(0,0,0)
- end
- wait(.3)
- end
- end))
- clon.Frame.Yes.MouseButton1Click:Connect(function()
- ans1 = ans1 + 1
- table.insert(whoans1,v.Name)
- clon:Destroy()
- end)
- clon.Frame.No.MouseButton1Click:Connect(function()
- ans2 = ans2 + 1
- table.insert(whoans2,v.Name)
- clon:Destroy()
- end)
- clon.Frame.Top.TextButton.MouseButton1Click:Connect(function()
- na = na + 1
- table.insert(whona,v.Name)
- clon:Destroy()
- end)
- coroutine.resume(coroutine.create(function()
- local bep = false
- for i=1,10 do
- local tim = (10-i) + 1
- if clon ~= nil and clon:FindFirstChild("Frame") ~= nil then
- clon.Frame.Time.Text = tostring(tim)
- wait(1)
- else
- break
- end
- if tim == 1 then bep = true end
- end
- repeat wait() until bep == true
- na = na + 1
- table.insert(whona,v.Name)
- wait()
- clon:Destroy()
- end))
- end
- wait(11)
- local clon = VoteResults:Clone()
- clon.Parent = player.PlayerGui
- clon.Frame:TweenPosition(UDim2.new(0.5,0,0.5,0),Enum.EasingDirection.Out,Enum.EasingStyle.Back,0.5,true)
- clon.Frame.Question.Text = arg[1]
- clon.Frame.AnswerGreen.AnswerName.Text = arg[2]
- clon.Frame.AnswerGreen.AnswerAmount.Text = tostring(ans1)
- clon.Frame.AnswerGrey.AnswerAmount.Text = tostring(na)
- clon.Frame.AnswerRed.AnswerName.Text = arg[3]
- clon.Frame.AnswerRed.AnswerAmount.Text = tostring(ans2)
- clon.Frame.Top.TextButton.MouseButton1Click:Connect(function()
- clon:Destroy()
- end)
- poll = false
- --Logging time
- warn("Players that chose "..arg[2]..":")
- for i,v in pairs(whoans1) do
- print(v)
- end
- warn("Players that chose "..arg[3]..":")
- for i,v in pairs(whoans2) do
- print(v)
- end
- warn("Players that did not choose:")
- for i,v in pairs(whona) do
- print(v)
- end
- else
- warn("There's another poll in progress")
- end
- end
- end
- end)
Add Comment
Please, Sign In to add comment