I don't know why it dosent remove from the value

game.Players.PlayerAdded:Connect(function(plr)
	local char = plr.Character or plr.CharacterAdded:Wait()
	task.spawn(function()
		while task.wait(0.1) do
			if char["Left Arm"]:WaitForChild("Bag").Bag.TCD.Value <= 0 then
				char["Left Arm"].Bag.Bag.TCD.Value = 0
			else
				char:WaitForChild("Left Arm"):WaitForChild("Bag").Bag.TCD.Value -= 0.1
			end
		end
	end)
	task.spawn(function()
		while task.wait(0.1) do
			if char["Left Arm"]:WaitForChild("Bag").Bag.TGCD.Value <= 0 then
				char["Left Arm"].Bag.Bag.TGCD.Value = 0
			else
				char:WaitForChild("Left Arm"):WaitForChild("Bag").Bag.TGCD.Value -= 0.1
			end
		end
	end)
end)

I don’t know why the first loop works fine but when the value is put to 1 on the second loop it stays one, i did some prints and it goes into the “char:WaitForChild(“Left Arm”):WaitForChild(“Bag”).Bag.TGCD.Value -= 0.1” but unlike the first it keeps staying 1?!? I have no idea what’s happening Im not even getting errors nothing…

If your Value Object is an IntValue then you can’t subtract it with decimal numbers. Change the Object to a NumberValue then you can do subtraction with decimal numbers.

oh my god dude i was so stupid tysm…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.