Script Activation

How can i make this script activate this script when a gamepass with the id 1613997626 is purchased

2 Likes

I’m pretty sure there is a couple/many tutorials but here’s the basic concepts to doing this.

  • Make a local script to enable/disable the other local script or whatever
  • With MarketPlaceService (i think it’s still that); check if the player owns that gamepass using the id
  • If the player has it then you simply need to change the script to become enabled via script.Enabled = true
2 Likes

Screenshot 2023-08-17 184247

1 Like

this is the script i want to activate when gamepass is bought

function OnDeveloperProductBought() -- use the parantheses and parameters!
   if GamepassId == 1613997626 then -- double '=' sign to compare (and put 'then')!
      script.Parent.Anchored = true
      script.Parent.Parent = workspace
      script.Parent.Transparency = 1
      -- wait() is unneccessary here
      script.Parent.Atom.Disabled = false
   end -- place the end at the correct position
end

script.Parent.Touched:Connect(OnDeveloperProductBought) -- do not put the parantheses in the connection callback!
1 Like

you can check through the players inventory to see if they own the gamepass and from there you can try calling the correct function?

1 Like

its a developer product not game pass
can you help me modify the script to work with the developer product called nuke with the id 1613997626

1 Like
local mps = game:GetService("MarketPlaceService")
local plrs = game:GetService("Players")

function OnDeveloperProductBought(receipt) -- use the parantheses and parameters!
   if receipt.ProductId == 1613997626 then -- double '=' sign to compare (and put 'then')!
   script.Parent.Anchored = true
      script.Parent.Parent = workspace
      script.Parent.Transparency = 1
      -- wait() is unneccessary here
      script.Parent.Atom.Disabled = false
   end -- place the end at the correct position
end

mps.ProcessReceipt=OnDeveloperProductBought
1 Like

thanks i will try it now!!!

1 Like

i still cant get it to work here is a screen of the children and parents
Screenshot 2023-08-17 184247

1 Like