Model = "Car"
players = game.Players.NumPlayers
votes = script.Parent.Votes
regen1 = game.Workspace:findFirstChild(Model):Clone()
regen2 = regen1:Clone()
regen3 = regen2:Clone()
function onTouched(hit)
voter = hit.Parent.Name
if script.Parent.Activated.Value == true and votes.Value >= players / 2 and script.Parent.Voters:findFirstChild(voter) ~= nil then
script.Parent.Activated = false
local n = Instance.new("NumberValue")
n.Parent = script.Parent.Voters
n.Name = hit.Parent.Name
game.Workspace:findFirstChild(Model):Remove()
regen3.Parent = game.Workspace
regen3:MakeJoints()
script.Parent.Activated.Value = true
end
end
script.Parent.Touched:connect(onTouched)
It's a vote regen, but it doesnt do anything when I touch the button. |