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

How do I make a Touched function that triggers when there is a child besides humanoid?

Asked by 5 years ago
Edited 5 years ago

I'm working on a remake of "The Underground War" By StickMasterLuke. In the game I have a "swuvel" that works fine. it has a child numbervalue called "Shovel". There is also a block with a script in it that looks for the numbervalue inside of the block, when it is found it turns transparent. But for some reason when the block touches it nothing happens. I know how to make the script find a humanoid or nothing, is there something I can make it detect something besides those two things? Script:

script.Parent.Touched:connect(function(hit)
    local shovel = hit:FindFirstChild('Shovel')

    if shovel then
        script.Parent.Transparency = 1

    end
end)
0
first of all, what is the shovel, and what is its parent theking48989987 2147 — 5y
0
the shovel is a number value, the parent is a brick named HitBlock, the parent of that is a tool called "swuvel" OneDelectableFruit 7 — 5y
0
I would put the script in the shovel instead of in every part in the game. This will prevent lots of lag OBenjOne 190 — 5y
0
what if I put a humanoid in it? OneDelectableFruit 7 — 5y

Answer this question