#how do i fix floating point errors

1 messages · Page 1 of 1 (latest)

radiant sleet
#

lscript

local firebar = script.Parent
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChild("Humanoid")
local antifloatingpoint = 1000

humanoid.HealthChanged:Connect(function()
    local maxfire = humanoid.MaxHealth
    local fire = humanoid.Health
    
    local newfirebarsize = UDim2.new(1,0,math.round(fire/maxfire * antifloatingpoint)/antifloatingpoint , 0)
    print(newfirebarsize)
    
end)
median mauve
#

math.round

radiant sleet
hybrid basin
obsidian oasis
#

math.round, math.floor, math.ciel