How to activate scripts

the easiest solution would be to use :GetDescendants()

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
		for i, scriptt in ipairs(script.Parent.Parent.Parent:GetDescendants()) do
if scriptt:IsA("Script") then
scriptt.Disabled = false
end
end
	end -- place the end at the correct position
end

mps.ProcessReceipt=OnDeveloperProductBought
2 Likes

il try ittttttttttttttttttttttttttttttttttttttttt

3 Likes

it didnt work big sad wait are the parents and childs in this script correct here is the model its a part off
Screenshot 2023-08-17 184247

1 Like

do you get anything at your output?

1 Like

see the scripts called qperfection weld and atom (dont worry about script called nuke) i need that script to activate those uhh lemee check

1 Like

its doesnt even show anything in command bar

1 Like

i dont know if its even activating it at all

1 Like

this might be one issue, try this: (just to test)

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

wait(5)
		script.Parent.Anchored = true
		script.Parent.Parent = workspace
		script.Parent.Transparency = 1
		-- wait() is unneccessary here
		for i, scriptt in ipairs(script.Parent.Parent.Parent:GetDescendants()) do
if scriptt:IsA("Script") then
scriptt.Disabled = false
end
end
1 Like

are you meaning to put an extra t after script?

also there is nowhere that says the gamepass id so how would that work?

yup, cause script is used to refer to the script you’re coding on so you can’t use it to name a variable, however you can use scriptt

it waits 5 seconds and the code runs without you having to buy anything, just to test if it works

where do i put script do i leave it in model or put it in script service or somwhere else

1 Like

leave it inside the model (words)

i did and it did not detonate sadlyyyyyyyyyyyyyyyyyyyyyyy

1 Like

do you get anything at your output?

I mean here not the command bar

1 Like

nope worrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrd

this was script before it was tweaked by me

function onTouch(hit)
script.Parent.Anchored = true
script.Parent.Parent = Workspace
script.Parent.Transparency = 1
wait()
script.Parent.Atom.Disabled = false
end

script.Parent.Touched:connect(onTouch)

1 Like

could you send me a .rblx file with your experience so I can check it?

how could i do that???