hey, how to make this localscript run in many parts in workspace? the parts will get created sometime in the workspace and i need this to run on them
local clickDetector = script.Parent.ClickDetector
local events = game:GetService("ReplicatedStorage")
local selectTowerEvent = events:WaitForChild("SelectTower")
local function onClicked(player)
local hrp = script.Parent.Parent.HumanoidRootPart
if hrp then
selectTowerEvent:FireServer(player, hrp)
end
end
clickDetector.MouseClick:Connect(onClicked)```
** You are now Level 1! **