basically im trying to make a voting system that involves these three parts. the circled parts are for the touched functions. i have something going but im trying to detect if either one of these three parts are touched which are stored in a table called voteParts if that makes sense…
script:
local manfacevote = workspace.manfacevote
local catmanfacevote = workspace.catmanfacevote
local shaggymanfacevote = workspace.shaggymanfacevote
local plrName = {}
--parts
local voteParts = {
manpart = workspace.manface,
catpart = workspace.catmanface,
shaggypart = workspace.shaggymanface
}
local vals = 0
local db = false
voteParts.Touched:Connect(function(hit) -- put a table of a list of parts doesnt work (lol mb)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if table.find(plrName, plr.Name) then return end
if db then return end
db=true
vals = vals + 1
if hit.Parent:FindFirstChild("Humanoid") then
manfacevote.SurfaceGui.TextLabel.Text = "votes: "..vals
table.insert(plrName, plr.Name)
print(plr.Name.." has voted. they can no longer vote again!")
end
db = false
end)