Hey everybody
I'd love some help on this. I have a large button that triggers these automatic doors when a player is nearby. My problem is that while I walk on this large button, my "Current" value bounces between 2 and 0. My guess is it's tracking the player and both his legs? How can I fix this?
function ontouched(hit)
if hit.Parent:FindFirstChild("Humanoid")~=nil then
current.Value = current.Value + 1
end
end
script.Parent.Touched:connect(ontouched)
function onleave(hit)
if hit.Parent:FindFirstChild("Humanoid")~=nil then
current.Value = current.Value - 1
end
end
script.Parent.TouchEnded:connect(onleave) |