I am trying to implement a “killer” chance system into my game, but I either end up with an outrageously long figure or 0% with/without using math.round
.
Here is my script:
while wait(1) do
local Players = game.Players.NumPlayers
if Players >= 2 then
wait()
script.Parent.Text = math.round((Players / Players) / Players) * 100 .." %"
else
wait()
script.Parent.Text = math.round((Players / Players) / Players) * 100 .." %"
end
end
Here are some illustrations of my problem:
Without math.round
With math.round
Ideally, I would like the value to remain clear for the player to see (e.g., 33.3%).