Scarf Gamepass Script

Hey Developers!

I’m trying to make a Scarf Gamepass and I need a script that when you buy it you own it

Thanks!

local ScarfGamepassID = 000000 -- your gamepass ID
local Players = game:GetService("Players")
local Market = game:GetService("MarketPlaceService")
local Storage = game:GetService("ServerStorage")
local Scarf = Storage:FindFirstChild("Scarf")

Players.PlayerAdded:Connect(function(Player)
   if Market:UserOwnsGamePassAsync(Player.UserId,ScarfGamepassID) then
     --means the player has that gamepass, you can now give a scarf hat to him[ put the scarf inside server storage
   end
end)

Note:
if you want the item to apply on the character even if they die, use CharacterAdded event.
[Use AddAccessory to equip the Scarf on their body.

1 Like

Thanks for the script! I’ll try it out later!

1 Like