#How do I make it not show decimals

9 messages · Page 1 of 1 (latest)

wanton sierra
#

heres the code


local Bank = {}
Bank.__index = Bank

function Bank.new(tycoon, instance)
    local self = setmetatable({}, Bank)
    self.Tycoon = tycoon
    self.Instance = instance
    self.Balance = 0

    return self
end

function Bank:Init()
    self.Tycoon:SubscribeTopic("WorthChange", function(...)
        self:OnWorthChange(...)
    end)
    self.Instance.Pad.Touched:Connect(function(...)
        self:OnTouched(...)
    end)
end

function Bank:OnWorthChange(worth)
    self.Balance += worth
    self:SetDisplay("♦" .. self.Balance)
end

function Bank:SetDisplay(str)
    self.Instance.Display.Primogems.Text = str
end

function Bank:OnTouched(hitPart)
    local character = hitPart:FindFirstAncestorWhichIsA("Model")
    if character then
        local player = game:GetService("Players"):GetPlayerFromCharacter(character)
        if player and player == self.Tycoon.Owner then
            local playerPrimogems = PlayerManager.GetPrimogems(player) + self.Balance
            PlayerManager.SetPrimogems(player, playerPrimogems)
            self.Balance = 0
            self:SetDisplay("♦0")
        end
    end
end

return Bank
glacial depot
#

math.round

wanton sierra
glacial depot
#

where ever the value that is displayed is written in the script

#

math.round(valueYouWantToRound)

#

any progress?

wanton sierra
#

yep, I got it

#

thanks

glacial depot
#

cool