Help I need to fix this script it's not working it suppose to regen the model? (Read Desc)
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.
01 | map = game.Workspace.ship |
02 | print ( "It works if this was printed" ) |
09 | function onChatted(msg, recipient, speaker) |
10 | if string.lower(string.sub(msg, 1 , 10 )) = = "voteregen" then |
11 | if playervoted(speaker.Name) = = false then |
12 | table.insert(voted, speaker.Name) |
13 | print ( speaker.Name .. " Inserted." ) |
31 | function playervoted(player) |
39 | function onPlayerEntered(newPlayer) |
40 | newPlayer.Chatted:connect( function (msg, recipient) onChatted(msg, recipient, newPlayer) end ) |
43 | function respawn(model) |
44 | backup = model:clone() |
47 | model = backup:clone() |
49 | model.Parent = game.Workspace |
55 | if votes > = 5 and time < 60 then |
61 | game.Players.ChildAdded:connect(onPlayerEntered) |
Thanks!