Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Voting poll won't pop up why? (Read Desc) for more details

Asked by 6 years ago

I'm trying to make it so when the noob is destroyed the vote to regen model pops up on the player's screen. Here's the script

local map = workspace.ship--Noob
print("It works if this was printed")


voted = {}
votes = 0
time = 0

function onChatted(msg, recipient, speaker)
    if string.lower(string.sub(msg,1,10)) == "voteregen" then
        if playervoted(speaker.Name) == nil then
            table.insert(voted, speaker.Name)
            print( speaker.Name ..  " Inserted.")
            votes = votes + 1
            if time == 0 then
                dotimer()
            end
        end
    end
end


function dotimer()

    for i = 1, 60 do
        time = time + 1
        wait(1)
    end
    time = 0
end
function playervoted(player)
    try = voted[player]
    if try ~= nil then
        return true
    end
    return false
end

function onPlayerEntered(newPlayer)
    newPlayer.Chatted:Connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) 
end

function respawn(model)
    backup = model:clone()
    model:Destroy()
    wait(2)
    model = backup:clone()
    model:makeJoints()
    model.Parent = game.Workspace
end


function startvote()
    if votes ~= 0 then
        if votes >= 5 and time < 60 then
            respawn(map)
        end
    end
end

game.Players.PlayerAdded:Connect(onPlayerEntered)
0
Like a ScreenGui? there's no code that relates to screen guis User#24403 69 — 6y
0
I know this is a stupid question but i don't know where to put it. That's why I need help. dontban_mer -36 — 6y

Answer this question