local connection
local tagList = {}
connection = newRock.Touched:Once(function(hit)
hitSound:Play()
newRock.Anchored = true
local hitRadius = 7
local params = OverlapParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = {creature.Parent}
params.MaxParts = 30
local objectsInSpace = workspace:GetPartBoundsInRadius(newRock.Position, hitRadius, params)
print(objectsInSpace)
for i, part in pairs(objectsInSpace) do
print("A")
local taggedHum = part.Parent:FindFirstChild("Humanoid")
if taggedHum and not tagList[taggedHum] then
tagList[taggedHum] = true
taggedHum:TakeDamage(25)
end
end
table.clear(tagList)
connection:Disconnect()
end)
Whenever the newRock
part hits something, it’s supposed to damage all Humans nearby.
Two things tend to happen, interchanging quite randomly:
-
It prints out a good list of
objectsInSpace
, being 'LeftHand, Head, Handle, Handle, UpperRightArm etc. , along with (A) printed about 7 to 22 times or so.
→ The Human gets damaged -
It prints out ‘Boulder’ (the name of the part) once or twice, with sometimes a Handle or Baseplate in it as well, never exceeding 5 A’s.
→ The Human takes no damage
Any reason as to why sometimes it doesn’t damage the human and other times it does?