Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

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

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

2 answers

✓ Accepted answer

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

while true do

if script.Parent.IntValue.Value == 2 then
script.Parent.Transparency = 1
wait()
else
	script.Parent.Transparency = 0
end
wait()
end

2 comments

0

tysm!

0

I dont even want to explain why you should NOT use while true do

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

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

2 comments

0

still doesnt work, btw i forgot to put end lol

0

What is the default value for the intvalue?

This discussion is preserved as it was. New answers, comments, and votes are closed.