so, I’m having an issue. I have a script that gets all tagged models then runs a script for them (it’s for towers in a tower defense), but the issue is when a tower is cloned the new tower doesn’t work. I’ve tried making it so when a new tower is added it runs the script again but that just resulted in all of them running twice.
Code:
function Tag()
for _, Tower in pairs(CollectionService:GetTagged("Tower")) do
Tower:FindFirstChild("HitBox"):FindFirstChildWhichIsA("ProximityPrompt").Triggered:Connect(function()
print("Ok")
end)
end
end
Tag()
workspace.Towers.DescendantAdded:Connect(function()
Tag()
end)
They tower that was there before the new tag says ok twice.