Hi I am Rob and I am a BEGINNER DEVELOPER.
Problem: When I test my obby, the Gamepass gears work perfectly right? Wrong! As soon as I died and respawned on the checkpoint, my gears were gone?!? Let me know if you have an answer to this problem!
Edit: I have tried the answerer's script but all it did was fling me up in the sky and then loopkilling me?
Answerer's Script:
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local gamePassID = 0000000 -- Change this to your game pass ID
local function onCharacterAdded(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.GearExample: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.CharacterAdded:Connect(onPlayerAdded)

3 comments
have you checked the output?
No
Sorry I don't understand I am new at Roblox Studio btw