local function onPlayerAdded(player)
local hasPass = false
-- Check if the player already owns the game pass
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
end)
-- If there's an error, issue a warning and exit the function
if not success then
warn("Error while checking if player has pass: " .. tostring(message))
return
end
if hasPass then
-- Double the backpack capacity
else
-- normal capacity
end
end
#I have a script for a bag but i want it so that it has double the capacity if the player owns a pass
1 messages · Page 1 of 1 (latest)
you just need to put the code that changes backpack capacity in the last if statement
then use that function in a player added event
yeah, just make sure to add the connection part else the function won't run
using Players.PlayerAdded
game.Players.PlayerAdded:Connect(onPlayerAdded)
just put that at the end
local pModel = player.Character or player.CharacterAdded:Wait()
could also just be the code you've written
I can't because I didn't write it, so I have no clue how it works
you'll need to make the max amount change if it's different based on the gamepass, else it always checks if it's over 5000
sorry man, but I've got other things to do