when i looked at your code the quotes seem to be messed up i redid them with singles…
also when the script runs and this get the tagged items the tagged parts may not be in workspace yet or loaded in…
you can get any that add with the GetInstanceAddedSignal
local collectionService = game:GetService('CollectionService')
local cursedElement = collectionService:GetTagged('CursedElement')
local players = game:GetService('Players')
local fallPart = workspace.Course.FallPart:WaitForChild('FallPart')
function SetupTouched(cursedPart)
cursedPart.Touched:Connect(function(otherPart)
print('Hello')
end)
end
for _, cursedPart in pairs(cursedElement) do
SetupTouched(cursedPart)
end
collectionService:GetInstanceAddedSignal('CursedElement'):Connect(function(cursedPart)
SetupTouched(cursedPart)
end)