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

Is there an easier way to do this?

I have a script, is there an easier way to do this?

if script.Parent.RedX.Visible=true and script.Parent.Parent.Target2.RedX.Visible=true and etc.. then
print("All targets have been killed! Points have been added! Now teleporting back to lobby")
end

1 comment

0

For some reason the code doesnt work. In the real script there is no space between the first "and" and the script.Parent.Parent

1 answer

✓ Accepted answer

Yes, remove the =true and it will work. The correct term was == true, but just if script.Parent.RedX.Visible then will work.

In case you got confused, here's your script fixed up.

if script.Parent.RedX.Visible and script.Parent.Parent.Target2.RedX.Visible and etc.. then
print("All targets have been killed! Points have been added! Now teleporting back to lobby")
end

2 comments

0

Well, I meant, is there an easier way than to list all the possible if's?

0

Well, not really. Unless you have variables that define all the if's, there's not short way.

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