#Hello I made a script and i am trying to access a surface gui

28 messages · Page 1 of 1 (latest)

abstract wolf
#

Before I dive into this, just a hint, read into guarding your if statements,

it comes down to changing out

if condition then

end

for

if not condition then return end

as you may see, your script is currently very wide, which tends to be harder to read. Guarding your if statements can reduce the white space on the left by a ton

reef haven
#

im just wondering if there are any shorter ways thatz this

abstract wolf
reef haven
#

so like local SurfaceGui = something something something

#

so i can have it as a

#

local

#

in the script

#

the script is inside SurfaceGui

abstract wolf
#

local SurfaceGui = workspace.Shit.Shit.SurfaceGui

reef haven
#

Ah

#

thanks

abstract wolf
#

But you should still dive into guarding your if statements

reef haven
#

also is this correct aswell?

#

i mean everything altogether works

#

just feels long

abstract wolf
# reef haven idk what does this mean

Basically, try to have your code stay vertical instead of horizontal. It helps a lot when dealing with readability later down the line. It’s just a good habit to get into. Generally speaking it’s advised to keep your code only 4 indents deep, at most. A bit more is still acceptable, but 5+ already becomes hard to read

#

Anyways, next time when you make satirical code, just loop through all descendants a few times and use a bit of syntax sugar. That’s way more fun than just indents

abstract wolf
reef haven
#

I couldnt make it longer cause it already

#

is longer than my screen

#

You took the fun out of it tho 😔

abstract wolf
#

you can do shit like

local Syntax = print
local Sugar = “Hello World!”
Syntax(Sugar)

reef haven
#

ah