Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't my infinite storage script work, the value is negative instead of positive?

Asked by 3 years ago

I want to make the storage 2^63 - 1, but when I test it out the GUI says Infinite, but the IntValue is -9223372036854775808 instead of 9223372036854775808. Does anyone know how to fix that? Here's the script:

print("test 1")
--If player owns Infinite storage gamepass
print("test 2")
game.Players.PlayerAdded:Connect(function(plr)
    print("test 3")
    local MarketPlaceService = game:GetService("MarketplaceService")
    local GamePassId = 12251737

    local storage = game.StarterGui.MainGUI.StorageBar.StorageAmount.Storage
    local storageText = game.StarterGui.MainGUI.StorageBar.StorageAmount

    local userID = plr.UserId
    print("test 4")
    if MarketPlaceService:UserOwnsGamePassAsync(userID,GamePassId)then
        print(plr.Name .. " owns gamepass.")
        storage.Value = 2^63 - 1
        storageText.Text = "Infinite"
        print("test 5")
    end
end)

2 answers

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Have you tried just simply typing the whole value out but one less?

print("test 1")
--If player owns Infinite storage gamepass
print("test 2")
game:GetService("Players")PlayerAdded:Connect(function(plr)
    print("test 3")
    local MarketPlaceService = game:GetService("MarketplaceService")
    local GamePassId = 12251737

    local storage = game.StarterGui.MainGUI.StorageBar.StorageAmount.Storage
    local storageText = game.StarterGui.MainGUI.StorageBar.StorageAmount

    local userID = plr.UserId
    print("test 4")
    if MarketPlaceService:UserOwnsGamePassAsync(userID,GamePassId)then
        print(plr.Name .. " owns gamepass.")
        storage.Value = 9223372036854775807
        storageText.Text = "Infinite"
        print("test 5")
    end
end)

0
you did `game.startergui` and not `game.players.startergui` Ilovecake333636 0 — 3y
0
There is no game:GetService("Players").StarterGui. game:GetService("StarterGui") simply replicates to the player. nekosiwifi 398 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

Ok, I fixed it. All I did was just make the number a digit less, so now it works I guess

Answer this question