admin管理员组

文章数量:1291027

I am using a "Big Number Module", It's called "EternityNum". and I am using it to bypass roblox's number limit. I am misusing the module somewhere in my script but I can't pinpoint where, and why. I have the documentation, if needed. I tried replacing stuff with other stuff, and it doesn't work.

Code:

local EtNum = require(game.ReplicatedStorage.EternityNum)
local OverHeadHandler = {}

local Stats = {
    { Name = "Cash", Color = Color3.fromRGB(0, 255, 0), Stroke = Color3.fromRGB(0, 150, 0) }
}

OverHeadHandler.CreateStats = function(Player)
    local Character = Player.Character or Player.CharacterAdded:Wait()
    local Head = Character:WaitForChild("Head")

    local Billboard = Instance.new("BillboardGui")
    Billboard.Name = "StatsDisplay"
    Billboard.Adornee = Head
    Billboard.Size = UDim2.new(4, 0, 1, 0)
    Billboard.StudsOffset = Vector3.new(0, 2.5, 0)
    Billboard.Parent = Head

    local MainFrame = Instance.new("Frame", Billboard)
    MainFrame.Name = "MainFrame"
    MainFrame.Size = UDim2.new(1, 0, 1, 0)
    MainFrame.BackgroundTransparency = 1

    local UIList = Instance.new("UIListLayout", MainFrame)
    UIList.SortOrder = Enum.SortOrder.LayoutOrder

    for _, stat in ipairs(Stats) do
        local TextLabel = Instance.new("TextLabel")
        TextLabel.Name = stat.Name
        TextLabel.Size = UDim2.new(1, 0, 0.2, 0)
        TextLabel.Text = stat.Name .. ": 0"
        TextLabel.TextColor3 = stat.Color
        TextLabel.BackgroundTransparency = 1
        TextLabel.Font = Enum.Font.FredokaOne
        TextLabel.TextSize = 16
        TextLabel.Parent = MainFrame

        local Stroke = Instance.new("UIStroke", TextLabel)
        Stroke.Color = stat.Stroke
    end
end

OverHeadHandler.UpdateStats = function(Player)
    local Character = Player.Character
    local Head = Character and Character:FindFirstChild("Head")
    local Billboard = Head and Head:FindFirstChild("StatsDisplay")

    if not Billboard then return end
    local MainFrame = Billboard:FindFirstChild("MainFrame")
    local StatsFolder = Player:FindFirstChild("leaderstats")

    if not MainFrame or not StatsFolder then return end

    for _, stat in ipairs(Stats) do
        local StatLabel = MainFrame:FindFirstChild(stat.Name)
        local StatValue = StatsFolder:FindFirstChild(stat.Name)
        if StatLabel and StatValue then
            local numValue = EtNum.fromString(StatValue.Value)
            StatLabel.Text = stat.Name .. ": " .. EtNum.short(numValue, 3)
        end
    end
end

game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    for _, stat in ipairs(Stats) do
        local StatValue = Instance.new("StringValue", leaderstats)
        StatValue.Name = stat.Name
        StatValue.Value = "1"
        StatValue.Changed:Connect(function()
            OverHeadHandler.UpdateStats(player)
        end)
    end

    player.CharacterAdded:Connect(function()
        OverHeadHandler.CreateStats(player)
        OverHeadHandler.UpdateStats(player)
    end)
end)

return OverHeadHandler

I tried basically everything I could think of.

本文标签: game developmentEternityNum Layer Is Returning InfiniteStack Overflow