Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

2 comments

0

you did game.startergui and not game.players.startergui

0

There is no game:GetService("Players").StarterGui. game:GetService("StarterGui") simply replicates to the player.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.