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

Help w/ ClickDetector?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago

When I click this part, the size grows in the y axis but it grows in 2 directions. I want it to grow just up, not down too.

script.Parent.ClickDetector.MouseClick:connect(function()
    local x = script.Parent.Size.X
    local y = script.Parent.Size.Y
    local z = script.Parent.Size.Z
    wait(1)
    script.Parent.Size = Vector3.new(x+0,y+.1,z+0)  

end)

1 answer

Log in to vote
0
Answered by 8 years ago

Try this

script.Parent.ClickDetector.MouseClick:connect(function()
    local s = script.Parent.Size
    wait(1)
    s = Vector3.new(s.X,s.Y+.1,s.Z)  

end)
Ad

Answer this question