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

This is the most complex script I have ever made so far, but why will it not work?

Asked by 5 years ago

All it is supposed to do is move a part named "Brick" up from a set position a fews times...but it won't work lol, help.

local Brick = script.Parent
function MoverTest()
    game.Workspace.Brick.Position = Vector3.new(-100.5, 80, 231)
    wait(0.5)
    game.Workspace.Brick.Position = Vector3.new(-100.5, 90, 231)
    wait(0.5)
    game.Workspace.Brick.Position = Vector3.new(-100.5, 100, 231)
    wait(0.5)
    end

1 answer

Log in to vote
1
Answered by 5 years ago

For one, you dont have to specify it as game.Workspace since you already have script.Parent. and you need to trigger the function.

If just once use

MoveTest()

If you want to link it to something else such as a clickdetector

Brick.ClickDetector.MouseButton1Click:connect(MoveTest)

I could be wrong but I believe that should work.

0
Oh thanks! I toyed with a while true do loop and managed to get it working :P hawkeye1940 8 — 5y
0
Your very welcome. BlauKitten 88 — 5y
Ad

Answer this question