I have already the gamepass in place, that I ask is that once they have the gamepass, they join in the game with a item, but I want that item be used only once and makes you unkillable for 1 min.
Here's the gamepass script FYI:
gps = game:GetService("GamePassService"); id = script:WaitForChild("GamePassID"); EH = script:WaitForChild("ExtraHealthAmount"); game.Workspace.ChildAdded:connect(function(char) h=char:FindFirstChild("Humanoid") if h~=nil then plr=game.Players:FindFirstChild(char.Name) if gps:PlayerHasPass(plr, id.Value) then h.MaxHealth=EH.Value h.Health=EH.Value end end end)
or is it this one? (still new to scripting)
local productId = 340496291 --My gamepass ID (example, random I choose) local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptPurchase(player, productId) end)