Currently, my script clones peneding on how many children there are. I would like it to only clone once. Any help is appreciated!!
for _, child in ipairs(workspace:GetChildren()) do
if child.Name == "BowlHit" then
child.ProximityPrompt.Enabled = true
local prompt = child:FindFirstChildOfClass("ProximityPrompt")
prompt.Triggered:Connect(function(player)
for _, child in ipairs(workspace:GetChildren()) do
if child.Name == "BowlHit" then
child:FindFirstChildOfClass("ProximityPrompt")
local bowlClone = game.ReplicatedStorage.MisoSoup:Clone()
bowlClone.Name = "Miso Soup"
bowlClone.Parent = game.Players.LocalPlayer.Backpack
bowlClone.Parent = game.Players.LocalPlayer.Character
bm1.Attachment1 = at1
bm1.Attachment0 = workspace:FindFirstChild("SinkHit").Attachment
for _, child in ipairs(workspace:GetChildren()) do
if child.Name == "SinkHit" then
child.ProximityPrompt.Enabled = true
end
end
end
end
end)
end
end