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

Why doesn't my item work when player touches it?

Asked by
JipSea 23
4 years ago
Edited 4 years ago

Hello! I am trying to make an item that increases the players Body Depth & Body Width onTouch. However; the below script is not working.. Please help!

function onTouched(hit)

    local Character = hit.Parent:FindFirstChild("Humanoid")
     local Humanoid = Character:FindFirstChild('Humanoid')

    if Humanoid then
        local BDS = Humanoid:FindFirstChild('BodyDepthScale')
        local BWS = Humanoid:FindFirstChild('BodyWidthScale')

        if BDS and BWS then
            BDS.Value = BDS.Value + .10
            BWS.Value = BWS.Value + .10


        end
    end
end
script.Parent.Touched:Connect(onTouched)



0
The issue is line 4. You're trying to find a Humanoid inside of another Humanoid. DeceptiveCaster 3761 — 4y

Answer this question