I was trying to do is make it where the player can vote to regen the model. The voting thing should pop up and should have a timer. Here's the script I was working on.
map = game.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) == false 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:remove()
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.ChildAdded:connect(onPlayerEntered)
Thanks!

18 comments
taken from a free model
Dude We have been doing all your scripts for you. You need to learn how to code instead of all of us doing it for you.
Also there you aren't explaining the script at all all you did was paste the script you didn't even tell us the error.
Look I promise you if you help me with this I won't ask for anything for tomorrow and for today. I just want this last thing and i'll be gone you won't see me until 3 days.
Any Errors?
It won't work for some reason I have it right but I don't know if there are any erros
Click f9 on your keyboard and see if there are any errors
Didn't work
Play the game and then click f9
The model probably doesn't exist so that means you are cloning something that doesn't exist, define it at the start of the code and clone it from there..
ok one sec
Nope no erros I think
hmm
Is the script a local script
no
change the game.Players.ChildAdded:connect(onPlayerEntered) to game.Players.PlayerAdded:Connect(onPlayerEntered)
witch number?
dude this isn't a site where you get people to code for you like this is actually stupid now