So'm i'm using this sword from roblox battle, and i'm trying to make it only attack a dummy a made. This is so you can't kill other players in the lobby. The dummy's name is Dummy. I don't get a error, it just doesn't do anything to the dummy. Help?
This is only a part of the script, not the full thing.
handle.Touched:connect(function(hit)
if equipped and character and humanoid and humanoid.Health > 0 and humanoid.Name == "Dummy" and not hit:isDescendantOf(character) then
local targethumanoid = hit.Parent:FindFirstChild("Humanoid")
if targethumanoid and targethumanoid.Health > 0 and not hithumanoids[targethumanoid] then
hithumanoids[targethumanoid] = true
for _, v in pairs(targethumanoid:GetChildren()) do
if v and v.Name == "creator" then
v:remove()
end
end
local tag = Instance.new("ObjectValue")
tag.Name = "creator"
tag.Value = player
debris:AddItem(tag, 3)
tag.Parent = targethumanoid
local damagemultiplier = 1
targethumanoid:TakeDamage(damage * (combo + 1) * damagemultiplier)
end
end
end)

2 comments
I attempted to do so at line 2, it's a long line.
Where is
humanoidandcharacterandequipped, etc, defined?