I’m trying to make a multiplier that increases as time goes. When I’m increasing the multiplier by 0.01, it’ll increase strangely.
(It works properly until 1.13)
My code:
local multiplier = script.Parent:WaitForChild("Multiplier")
local randomTime = math.random(1,100)
local timer = 0
local function multiplierFunc()
for _,v in pairs(game.Players:GetChildren()) do
while true do
wait(0.5)
v.PlayerGui.ScreenGui.Multiplier.Text = v.PlayerGui.ScreenGui.Multiplier.ActiveNum.Value
v.PlayerGui.ScreenGui.Multiplier.ActiveNum.Value = v.PlayerGui.ScreenGui.Multiplier.ActiveNum.Value + 0.01
timer = timer + 1
if timer == randomTime then
break
end
end
end
end
local multiplier = script.Parent:WaitForChild("Multiplier")
local randomTime = math.random(1,100)
local timer = 0
local function multiplierFunc()
for _,v in pairs(game.Players:GetChildren()) do
while true do
wait(0.5)
v.PlayerGui.ScreenGui.Multiplier.Text = v.PlayerGui.ScreenGui.Multiplier.ActiveNum.Value
v.PlayerGui.ScreenGui.Multiplier.Text = string.sub(v.PlayerGui.ScreenGui.Multiplier.Text , 1 , 4)
v.PlayerGui.ScreenGui.Multiplier.ActiveNum.Value = v.PlayerGui.ScreenGui.Multiplier.ActiveNum.Value + 0.01
timer = timer + 1
if timer == randomTime then
break
end
end
end
end
That’s a common error that happens with computers when it comes to Float digits, you can try formatting the string so it doesn’t show more than 2 numbers after the period