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

Rising block script not working?

Asked by 9 years ago

Hello,the point of this script was that when the user clicked a button it will loop through workspace and find all the parts named "jumpart" and raise them i did some troubleshooting and it seemed that the problem arised from the second for loop, where [i] is set to the default height of the brick. I get the error x is not a valid member of Part. I thought about using tables but i did not think it will really help. Thanks for taking your time to read this post.

Debounce=false
function onClicked()
children=game.Workspace:GetChildren()
if not Debounce then
      Debounce=true
           for i,v in pairs(children)do

                if v.Name=="jumpart" then

                     for i=4,13 do

                           v.Size=Vector3.new(v.x,i,v.z)

                     end
          end
end

 Debounce=false
end

end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

Log in to vote
1
Answered by 9 years ago

You need to get the X and Z property from the .Size property of the part.

v.Size = Vector3.new(v.Size.X, i, v.Size.Z)
0
lol oh yeah thank you so much i feel stupid now. threatboy101 2 — 9y
0
lol it raises them one by one i will probably need to make a table and get all the parts first lol. threatboy101 2 — 9y
0
can you help me implement the table? threatboy101 2 — 9y
Ad

Answer this question