hey developers! i have a weird issue with stringvalues. i have an issue where i minus 0.05 off the stringvalue. sometimes, it randomly has .9999 instead of the actual number. for example, 0.8 is replaced with 0.799999. i tried to search up fixes for it but i couldn’t find any. here’s the code:
local player = script.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if player:FindFirstChild("leaderstats"):FindFirstChild("Cash").Value >= player:FindFirstChild("cooldownMoney").Value then
player:FindFirstChild("leaderstats"):FindFirstChild("Cash").Value -= player:FindFirstChild("cooldownMoney").Value
player:FindFirstChild("cooldownMoney").Value += math.random(25, 50)
player:FindFirstChild("cooldownValue").Value -= 0.05
game:GetService("ReplicatedStorage").remoteEvents:WaitForChild("confettiClient"):FireClient(player)
end
end)
any help appreciated!