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

Why won't this work?

Asked by 10 years ago

I have a brick named Jim. I want Jim to switch to random colors. Example: green, (waits 1 second) red (waits 1 second) blue (wait 1 second). You should get the point. Here is the snippit

while true do jim.BrickColor.Random() wait(1) jim.BrickColor.Random() wait(1) end

Now, when I run it. It does nothing. Also I want Jim to go transparency for 2 seconds then back to normal. Example: Jim is in transparency .5, in 2 seconds he'll switch to transparency .0 and it will be a loop. Here is a snippit

jim=script.Parent while jim do jim.Transparency=.5 wait(2) jim.Transparency=0 wait(2) end

Any help?

2
You defined "jim", correct? Freemium 110 — 10y
0
I don't think so. Roboy5857 20 — 10y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

Here..

jim = game.Workspace.Jim
while true do
jim.BrickColor = BrickColor.random()
wait(1)
end

For your 2nd one...

jim = script.Parent
while true do
jim.Transparency = .5
wait(2)
jim.Transparency = 0
wait(2)
jim.Transparency = 1
end
0
Thanks. It works :D Roboy5857 20 — 10y
0
No problem. Give some credit to C0de. I thought you already had "jim" defined correctly. Shawnyg 4330 — 10y
0
Okay. Roboy5857 20 — 10y
Ad

Answer this question