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

How do I make it onTouch, size change?

Asked by 5 years ago

Why doesn't this script work? I tried to make it so when the player has touched the brick, if they're configured for R15 then their scale is slightly increased. Any help is greatly appreciated!

Link to the code here

1 answer

Log in to vote
0
Answered by 5 years ago

If all you want is their size to change on touch then do something like this.

    script.Parent.Touched:Connect(function(part)
        local human = part.Parent:FindFirstChild("Humanoid")
        if human ~= nil then
            local sizeChange = 1.12
            human.BodyHeightScale.Value = sizeChange
            human.BodyWidthScale.Value = sizeChange
            human.BodyDepthScale.Value = sizeChange
            human.HeadScale.Value = sizeChange
        end
    end)

It looked like you were trying to wait for the player to load after the player has already touched the brick as well as change the team they are on? Not sure what the overall goal is for your scenario, but for size change on a brick touch, you would do something like the above.

Ad

Answer this question