Hey. Basically touches don’t get detected by a dummy for some reason.
It doesn’t even print “Touched” which is pretty weird.
Here is my script:
local alreadyDamaged = {}
...
game:GetService("ReplicatedStorage").fire.OnServerEvent:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoidRootPart = char.HumanoidRootPart
local human = char.Humanoid
...
local function onTouched(hit)
print("Touched!")
print(hit)
if hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") then
local Hithumanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid") or hit.Parent.Parent:FindFirstChildWhichIsA("Humanoid")
local Hitcharacter = Hithumanoid.Parent
if Hitcharacter.Name ~= plr.Name then
print("Not Character")
if not table.find(alreadyDamaged, Hitcharacter.Name) then
print("Not found")
--He isn't on the list yet, damage him
table.insert(alreadyDamaged, #alreadyDamaged+1, Hitcharacter.Name)
Hitcharacter:TakeDamage(damage)
wait(cooldown)
table.remove(alreadyDamaged, table.find(alreadyDamaged, Hitcharacter.Name))
else
--He is on the list already, don't damage him
wait(cooldown)
if table.find(alreadyDamaged, Hitcharacter.Name) then
table.remove(alreadyDamaged, table.find(alreadyDamaged, Hitcharacter.Name))
end
end
end
end
end
...
For some reason it doesn’t detect the touches of dummies, but only of myself. When I walk infront of it, it does print “Touched” etc.
Here is a video about the weird behaviour:
If you need any more information, tell me.