Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Rising block script not working?

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

✓ Accepted answer

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)

3 comments

0

lol oh yeah thank you so much i feel stupid now.

0

lol it raises them one by one i will probably need to make a table and get all the parts first lol.

0

can you help me implement the table?

This discussion is preserved as it was. New answers, comments, and votes are closed.