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

How does this weapon not hurt the dummy, even though the hitbox is clearing touching them?

Asked by 4 years ago

To replicate this problem, follow these steps:

  1. Open this file. https://mega.nz/file/SJAVRYyK#9xr92vqZEjhhYlSAE6AfUkapMh1XUKzHB9pGbHCUXz4

  2. Open the rbxm.

  3. Put the tool into the starterpack

  4. Place a dummy

  5. Press play and then see if you can hurt the dummy.

If nobody can hurt the dummy can any of you guys see what's wrong? I use that same script for the hitbox in other tools and it seems to work just fine. But not for this one. Thanks.

0
I tried downloading the tool but when I did and open the file I got a error message please just put the damage script for the tool Eric_pokemon 133 — 4y
0
I feel like you wouldn't really understand why it doesn't work unless you see for yourself by opening the file but alright. comfycouchman 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Heres the damage script.

local tool = script.Parent.Parent
local event = tool:WaitForChild("RemoteEvent")
local canattack = false
local Music = script.Parent.Sound

script.Parent.Touched:Connect(function(hit) 
    local ehum = hit.Parent:FindFirstChildOfClass("Humanoid")
    if canattack and ehum then
        ehum:TakeDamage(math.random(25, 30))
    end
end)

0
canattack is false, so it does no damage Brandon1881 721 — 4y
0
oh ok. fixed my problem comfycouchman 0 — 4y
Ad

Answer this question