Code:
function touched(hit,pad)
if pad then
if canVote then
if hit.Parent:FindFirstChild("Humanoid")then
local char = hit.Parent
local charplr = players:GetPlayerFromCharacter(char)
if charplr:FindFirstChild("Vote") and charplr ~= nil then
pad.Votes.Value += 1
if charplr.Vote.Value ~= "" then
local padToSub = voting:FindFirstChild(charplr:FindFirstChild("Vote").Value)
padToSub.Votes.Value -= 1
end
charplr.Vote.Value = pad.Name
module.updateDisplay()
end
end
end
end
end
connection = vote1.Touched:Connect(touched(vote1))
connection2 = vote2.Touched:Connect(touched(vote2))
connection3 = vote3.Touched:Connect(touched(vote3))
It’s erroring on the last 3 lines- and it says that the value passed is not a function. I don’t understand why this would be happening, as touched has just been stated as a function before.
Probably just a dumb error, but I haven’t been able to get it to work in the last hour.