Hi guys I'm working on an obby here
Problem: Whenever I test my obby, it gives me the gamepass gears like normal right? Well, when I tried died in my obby and I respawn, my gears just disappeared?!? Let me know if you have an answer!
Script:
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local gamePassID = 0000000 -- Change this to your game pass ID
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 == true then
game.ServerStorage.Name:Clone().Parent = player.Backpack
-- Assign this player the ability or bonus related to the game pass
--
end
end
-- Connect "PlayerAdded" events to the "onPlayerAdded()" function
Players.PlayerAdded:Connect(onPlayerAdded)

6 comments
You mean StarterPack?
Yes I think she means starter pack
@Feahren Ok so I tried doing yours by placing my assets in ServerStorage and create a duplicate to be put in StarterPack but the result was basically two sets of the same gears and when I die it onlys leaves me to have to the StarterPack set of the gears?!?
Apologies, I wrote this very late at night. Essentially, you are to Clone a copy into StarterPack when moving the Gamepass Tool into the Backpack.
So you are saying that I should change the Backpack to StarterPack in the script but move the tool to where? I'm sorry I can't find what you mean by "Backpack" in Explorer
And also if you have time can you write a new script sample in your answer please! Thank you for your help!