I'm making this round-based game. At the end of each game it makes a gui visible that says; "You did it better than x%"

Would that be buggy?

Let's just say the module will return the amount of players that played the game;

local AmountOfPlayers = require(game.ReplicatedStorage.Modules.AmountOfPlayers)
local PlayersThatLost = require(game.ReplicatedStorage.Modules.PlayersThatLost)


function GetPercentage(v0)
   if tonumber(PlayersThatPlayedGame) > 0 then;
     local Percentage = (PlayersThatPlayedGame / AmountOfPlayers) * v0;
        return Percentage
     end
end)

local Percentage = GetPercentage(1)
local TextLabel = script.Parent
TextLabel.Text = "You did it better than; " .. tostring(Percentage) .. "% of people!"

3 comments

0

I doubt it

0

you can get rid of the tonumber and tostring, it would just be better to have your module built to return a number in the first place

0

sure thanks!