ProximityPrompt not inserted

I am currently using Instance.New to make a ProximityPrompt inside of a part, although the issue is that I need to put it into several parts and it is currently not putting it into some of the specified parts, the code responsible for putting in the ProximityPrompt will be shown below

P.S I tried using Instance:Clone but it has the same result

for _, Regener in ipairs(RegenerFolder:GetChildren()) do
	local prompt = script.ProximityPrompt:Clone()
	prompt.Parent = Regener
	prompt.ActionText = "Spawn " .. Regener.Model.Value.Name
	end)
end
for _, Regener in ipairs(RegenerFolder:GetChildren()) do
	local prompt = script.ProximityPrompt:Clone()
	prompt.Parent = Regener
	prompt.ActionText = "Spawn " .. Regener.Model.Value.Name
end

grafik not sure why there is an end) :thinking:

Oh sorry haha I’ll send the entire script this may be a bit confusing

for _, Regener in ipairs(RegenerFolder:GetChildren()) do
	local prompt = script.ProximityPrompt:Clone()
	prompt.Parent = Regener
	prompt.ActionText = "Spawn " .. Regener.Model.Value.Name

	local Debounce = Instance.new("BoolValue")
	Debounce.Name = "Debounce"
	Debounce.Parent = Regener

	prompt.Triggered:Connect(function(Player)
		Triggered(Regener, Player)
	end)
end

I think you’re suppose to have a Primary Part set inside the Model you’re putting the ProximityPrompt in so it can work.

The Model is a value, not an actual model

Is “regener” a model, Or a part?

I have said multiple times it is a part

What exactly do you mean “specific parts”? I tried the script, with a few changes and it worked fine, all the proximity prompts we’re cloned, values we’re created too.

There are 23 parts in a folder in a few of them the prompt does not insert

Interesting, I added 23 parts and everything is cloned correctly. Are you sure these parts are actually part of the folder?

I’ll check maybe a few are outside

Yes they are

Restriction of characters

That’s weird to be honest, it’s all working over on my side. I just removed the ActionText section. Assuming your doing this by a script?

Yes it is a serverscript in serverscriptservice

Hm, I have no idea what could be wrong. Try printing Regener in your for loop and see if all 23 parts come up.

1 Like

I did that it prints but still isnt inserted into some

oh wait i just realised that it might be blocked by some other part let me check

It was inserted but I wasnt able to see