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

question, how to fix this IF STATEMENT????

Asked by 5 years ago
Edited 5 years ago

im trying to make a script that if an intvalue is 2, then this brick is not transparent, but it doesn't work. im a beginner dev btw

1if script.Parent.IntValue.Value == 2 then
2script.Parent.Transparency = 1
3end

idk why it doesn't work, any help would be appreciated. thanks!

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Yea the problem is that it only checks once and that is when the player joins try this

01while true do
02 
03if script.Parent.IntValue.Value == 2 then
04script.Parent.Transparency = 1
05wait()
06else
07    script.Parent.Transparency = 0
08end
09wait()
10end
0
tysm! BuzzKillGT 33 — 5y
0
I dont even want to explain why you should NOT use while true do Arkrei 389 — 5y
Ad
Log in to vote
1
Answered by 5 years ago

HI, you forgot to put end. This is the fixed script:

1if script.Parent.IntValue.Value == 2 then
2    script.Parent.Transparency = 1
3end
0
still doesnt work, btw i forgot to put end lol BuzzKillGT 33 — 5y
0
What is the default value for the intvalue? HomieFirePGN 137 — 5y

Answer this question