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

Is there an easier way to do this?

Asked by 10 years ago

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
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 Tempestatem 884 — 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

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

0
Well, I meant, is there an easier way than to list all the possible if's? Tempestatem 884 — 10y
0
Well, not really. Unless you have variables that define all the if's, there's not short way. Shawnyg 4330 — 10y
Ad

Answer this question