Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

why wont my sword print the parent of the thing its touching or t make humanoids take damage?

Asked by
Jumbuu 110
9 years ago
01script.Parent.Blade.Touched:connect(function(hit)
02    if equipped and character and humanoid and humanoid.Health >= 0 and hit and not hit:IsDecendantOf(character) then
03        target = hit.Parent:FindFirstChild'Humanoid'
04        if target and target.Health >= 0 then
05            print(hit.Parent.Name)
06            target:TakeDamage(damage)
07 
08        end
09        end
10    end)
1
try doing the hit event in another script, because at the current point, you are trying to do to much in 1 script. scottmike0 40 — 9y

1 answer

Log in to vote
1
Answered by
Rawblocky 217 Moderation Voter
9 years ago

Just change all the stuff inside it to this:

1script.Parent.Blade.Touched:connect(function(hit)
2    if hit.Parent.Humanoid ~= nil then
3    hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - (The damage u want)
4        end
5    end)
Ad

Answer this question