Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local VoteCountToFix = 0
- local FixGame = false
- local Players = {}
- local chat = game:GetService("Chat")
- for i,v in next, script:GetChildren() do
- v:Clone().Parent = chat
- end
- function SendData(Amount)
- if(VoteCountToFix == 5) then
- VoteCountToFix = 0
- else
- VoteCountToFix = VoteCountToFix + Amount
- end
- end
- for i,v in next, game:GetService("Players"):GetPlayers() do
- Players[v.Name] = {hasVoted = false}
- v.Chatted:connect(function(Msg)
- if(Msg:lower()=="votefix/") then
- if(Players[v.Name].hasVoted == true) then
- warn("You have already voted!")
- else
- Players[v.Name].hasVoted = true
- SendData(1)
- end
- end
- end)
- end
- game:GetService("Players").PlayerAdded:connect(function(v)
- Players[v.Name] = {hasVoted = false}
- v.Chatted:connect(function(Msg)
- if(Msg:lower()=="votefix/") then
- if(Players[v.Name].hasVoted == true) then
- warn("You have already voted!")
- else
- Players[v.Name].hasVoted = true
- SendData(1)
- end
- end
- end)
- end)
- spawn(function()
- while wait(1) do
- print(VoteCountToFix)
- end
- end)
- spawn(function()
- while wait(1) do
- return Players
- end
- end)
- function MakeLoop()
- while true do wait()
- if(VoteCountToFix == 5) then
- FixGame = true
- warn("Fixing game!")
- break
- else
- if(FixGame == false) then
- VoteCountToFix = 0
- break
- end
- end
- end
- end
- MakeLoop()
- delay(0,function()
- while true do wait()
- if(FixGame == true) then
- pcall(function()
- workspace.BuildingPlates:remove()
- workspace["Smooth Block Model"]:remove()
- workspace.SpawnPoints:remove()
- workspace.Grass:remove()
- FixGame = false
- chat.BuildingPlates:Clone().Parent = workspace
- chat.SpawnPoints:Clone().Parent = workspace
- chat.Grass:Clone().Parent = workspace
- chat["Smooth Block Model"]:Clone().Parent = workspace
- for a,s in next, game:GetService("Players"):GetPlayers() do
- s:LoadCharacter()
- end
- for q,w in next, Players do
- w.hasVoted = false
- end
- end)
- warn("Game fixed!")
- MakeLoop()
- break
- end
- end
- end)
- return nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement