I’m trying to make a infinite storage gamepass for my game and I’m using math.huge to make a value infinite. However I am new to using math.huge
The issue here is whenever i type in math.huge when i am trying to set a value and play the game it just resets.
Solutions i have tried so far are just spamming 9’s to get it to infinite but I feel like that is a inefficient way and not necessary as I want it to actually say “inf” instead of a long number.
Anyway Heres The Full Script:
local sStorage = game:GetService("ServerStorage")
local mps = game:GetService("MarketplaceService")
local player = game:GetService("Players")
local gamepassModule = require(game.ReplicatedStorage.Modules.Gamepasses)
local infiniteStorageId = gamepassModule.gamepass5
local infinity = math.huge
local DSS = game:GetService("DataStoreService")
local backpackdataStore = DSS:GetDataStore("BackpackSave2")
game.Players.PlayerAdded:Connect(function(player)
local boostValues = Instance.new("Folder", player)
boostValues.Name = "BoostValues"
local MaxCapacity = Instance.new("IntValue")
MaxCapacity.Name = "CapacityMultiplier"
MaxCapacity.Parent = boostValues
MaxCapacity.Value = 2500
local hasInfiniteStorage = Instance.new("BoolValue", player)
hasInfiniteStorage.Name = "hasInfiniteStorage"
if mps:UserOwnsGamePassAsync(player.UserId, infiniteStorageId) then
hasInfiniteStorage.Value = true
if hasInfiniteStorage.Value == true then
MaxCapacity.Value = MaxCapacity.Value + infinity
end
end
player.CharacterAdded:Connect(function(char)
local backpack = sStorage:WaitForChild("Backpacks").DefaultPizzaBackpack:Clone()
backpack.CFrame = char.UpperTorso.CFrame * CFrame.new(0, 0, 1) * CFrame.Angles(0, math.rad(270), 0) * CFrame.fromOrientation(90,0,0)
backpack.BackWeld.Part0 = backpack
backpack.BackWeld.Part1 = char.UpperTorso
backpack.Parent = char
end)
end)