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)