So I made a server script that made a new folder called "Gamepasses" and inside the folder is a boolvalue named "BlueFire" and is set to false
what I want to do with the gamepass is set that value to true
local id = 9736269 game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased) if purchased and id == ido then plr.Gamepasses.BlueFire.Value = true end end) game.Players.PlayerAdded:Connect(function(plr) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,id) then game.Players:WaitForChild(plr.Name).Gamepasses.BlueFire.Value = true end end)
It was working fine but then I added datastore2 and some reason it doesn't work idk y.
Try something like this
local Lighting = game:GetService("Lighting") local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local gamepassId = 8900287 --Put the ID of the asset here local function onPlayerAdded(player) local function onCharacterAdded(character) if MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassId) then player.Gamepasses.BlueFire.Value = true end end if player.Character then onCharacterAdded(player.Character) end player.CharacterAdded:Connect(onCharacterAdded) end Players.PlayerAdded:Connect(onPlayerAdded)