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

Anyhow that I can Shorten this Script, it looks so repetitive?

Asked by
Borrahh 265 Moderation Voter
4 years ago
local remote1 = workspace.remote1
local remote2 = workspace.remote2
local remote3 = workspace.remote3

local theme1 = workspace.theme1
local theme2 = workspace.theme2
local theme3 = workspace.theme3

Is there a way to shorten this script?

1 answer

Log in to vote
1
Answered by
Narunzo 172
4 years ago
Edited 4 years ago
local remote1, remote2, remote3 = workspace.remote1, workspace.remote2, workspace.remote3
local theme1, theme2, theme3 = workspace.theme1, workspace.theme2, workspace.theme3

I would also recommend you change your variables to text instead of numbers as it my cause unexpected errors.

Never mind ignore what I just edited in, I wasn't thinking.

0
How would I access them, eg if remote2.BrickColor == theme2.BrickColor then print("Hello") Borrahh 265 — 4y
0
They are still the same just not on multiple lines. So yes you would access them like that. Narunzo 172 — 4y
0
Did this help? Narunzo 172 — 4y
Ad

Answer this question