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
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
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
Well, I meant, is there an easier way than to list all the possible if's?
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.
1 comment
For some reason the code doesnt work. In the real script there is no space between the first "and" and the script.Parent.Parent