Hello, does anyone know why the value is going down at like 10 per second instead of just 1?
Script:
local carryon2
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if script.Parent.Value.Value == 0 then
if game.Players:FindFirstChild(hit.Parent.Name).gangSystem.isInGang.Value == true then
script.Parent.Value.Value = 120
end
end
end
end)
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if script.Parent.Value.Value > 0 then
if game.Players:FindFirstChild(hit.Parent.Name).gangSystem.isInGang.Value == true then
carryon2 = false
while true do
wait(1)
if carryon2 == false then
script.Parent.Value.Value -= 1
if carryon2 == true then
break
end
end
end
end
end
end
end)
script.Parent.TouchEnded:Connect(function(hit)
carryon2 = true
end)
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
if script.Parent.Value.Value == 0 then
if game.Players:FindFirstChild(hit.Parent.Name).gangSystem.isInGang.Value == true then
script.Parent.Value.Value = 120
end
end
end
end)
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
if script.Parent.Value.Value > 0 then
if game.Players:FindFirstChild(hit.Parent.Name).gangSystem.isInGang.Value == true then
carryon2 = false
while true do
wait(1)
if carryon2 == false then
script.Parent.Value.Value -= 1
if carryon2 == true then
break
end
end
end
end
end
end
end)
script.parent.touchedended basically when the player leaves the part, meaning multiple of the other players body parts can enter it, and deduct the value
Exactly, that’s what I’m trying to do. When the player leaves the part, I want it to stop counting. This is not the issue, the issue is, when touched, it goes down too fast…