Hi everyone, i’m trying to set multiple proximity prompts on parts inside a folder like this
for i,v in ipairs(Workspace.Folder:GetChildren()) do
Prompt = Instance.new("ProximityPrompt")
Prompt.Name = "Prompt"
Prompt.Parent = v
Prompt.HoldDuration = 1
Prompt.ObjectText = "Pick up"
end
At this point based on how much parts you have in Folder the script will spawn prompts in every part having for example 10 parts with a prompt for everyone
You could put a proximity prompt in the replicated storage with a script like this inside of it. Then, instead of making a new one, you just clone the proximity prompt into the parts.
local prompt = game:GetService("ReplicatedStorage").ProximityPrompt:Clone()
for i,v in ipairs(Workspace.Folder:GetChildren()) do
Prompt.Parent = v
end
I don’t know if instances make the game laggy if they have scripts inside, however since they all have proximity prompts inside, I don’t think this makes it a lot more laggy than it already is. Maybe you can try it and compare the performance.