Hello, I'm extremely new to scripting and I've been trying to figure out how to make a moving part with a text button. What I've tried so far is obviously putting a TextButton inside a ScreenGUI (yes I put this in StarterGui) and entered a script. This is what I wrote inside the script:
local brick = game.Workspace.MovingPart
moveX = 0
moveY = 0.1
moveZ = 0
function Click()
brick.CFrame = brick.Cframe - Vector3.new (moveX, moveY, moveZ)
wait (0.1)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ)
wait (0.1)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ)
wait (0.1)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ)
wait (0.1)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ)
wait (0.1)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ)
wait (0.1)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ)
wait (0.1)
end
script.Parent.MouseButton1Down:connect(Click)
plz send help D:

2 comments
Thanks, I will contact you if I need some help!
I tried it and it didn't work. There were no errors in the Output tab.