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

Why is this not working?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

Im trying to make it to where if a brick doesn't move then it turns invisible but if it does it isn't invisible

Can you help???

local brick = script.Parent
if brick then
    local move = brick.Position + 1
    if not move then
        brick.Transparency = 1
    else
        brick.Transparency =0
    end
end

1 answer

Log in to vote
0
Answered by 10 years ago

Okay, I'm young and not the best scripter so sorry if I'm wrong.

"if brick then" I think you have to literally say something about the brick like

if brick.BrickColor = "Bright red" then (code) end

Also, local move = brick.Position + 1

I think you have to do local move = brick.Position.Y +1 Y could be Y, Z, or X depending on which direction your saying it would move in.

0
Woops, if brick.BrickColor = "Bright red" then (code) end should have two equals sign like if brick.BrickColor == "Bright red" then (code) end Rep0man 0 — 10y
0
No see the brick is in a local "local brick= script.Parent" meaning the brick stands for script.Parent and if it is script.Parent then there would be a code. IcyEvil 260 — 10y
Ad

Answer this question