#is there a simpler way to write this without using game.workspace

125 messages · Page 1 of 1 (latest)

pure radish
#

please help

#

im bad at scripting

ornate wren
#

theres nothing wrong with using game.workspace tho

pure radish
ornate wren
#

wdym

pure radish
#

like you can insert models right

#

doing stuff like :ins with admin commands

south socket
#

you want to check server storage?

pure radish
#

well like what if i put one model in workspace and one model in serverstorage

fallen palmBOT
#

studio** You are now Level 1! **studio

south socket
#

you need to make a seperate variable with game.GetService:(serverstorage) or smth along those lines

#

then you can simply do (variable).waitforchild:(thing your looking for )

pure radish
#

so if i do that it doesnt matter if its in workspace or serverstorage?

south socket
#

i mean you can use either

#

servestorage is just abit harder to get to

#

actually im pretty sure you cna just do game.serverstorage but i'd reccomend the varible if you plan to reuse the object

pure radish
old birch
#

you can do that

pure radish
#

how do i fix the error under local

#

because it wasnt there when i did it without or im pretty sure

old birch
#

if u hover your mouse over it, it will tell you the issue

#

over the local

pure radish
#

expected identifier when parsing expression got local

old birch
#

there msut be a error

#

above that line of code

pure radish
#

its saying this

#

but how come its not looking in workspace if i did serverstorage or workspace

old birch
#

put game.Workspace["CRJ-200"] before

#

the game.ServerStorage

#

therefore it will check workspace first

pure radish
old birch
#

it should be fine

#

as long as theres 1 in workspace or serverstorage

pure radish
#

ok i inserted it through admin from serverstorage

#

and its saying the same thing

#

i dont know if i need to do some other script to insert it

old birch
#

:WaitForChild() maybe?

pure radish
#

saying this now

#

also not sure if i put waitforchild in the right place or not

old birch
#

put in "CRJ-200" inside the () of WaitForChild

#

WaitForChild("CRJ-200")

pure radish
fallen palmBOT
#

studio** You are now Level 2! **studio

pure radish
#

infinite yield possible now

old birch
#

maybe jsut do a if statement to check if exists

pure radish
#

if infront of the game.workspace stuff?

old birch
#
local PLANE

if game.Workspace:FindFirstChild("CRJ-200") then
  PLANE = game.Workspace:FindFirstChild("CRJ-200")
elseif game.ServerStorage:FindFirstChild("CRJ-200") then
  PLANE = game.ServerStorage:FindFirstChild("CRJ-200")
end```
pure radish
#

the light only works when its started in workspace

old birch
#

is the spotlight inside the CRJ-200

pure radish
#

yeah its in crj-200.Lights.BEACON.SpotLight

old birch
#

do u turn it on through code? or is it always on?

pure radish
old birch
pure radish
old birch
#

if its inside beacon then yes

pure radish
#

shows this now

old birch
#

BEACON doesnt have a enabled value

#

what is beacon

pure radish
#

a light

old birch
#

a spotlight?

pure radish
#

yeah

#

spotlight

#

its like this

#

i turned off enabled because it starts off

old birch
#

do you have anything else called beacon inside the CRJ-200

#

oh

#

wait

pure radish
#

button

old birch
#

do BEACON.SpotLight.Enabled = true

pure radish
#

right at the start of the script?

old birch
#

where ever u change enabled to true or false

pure radish
#

do i change plane:findfirstchild"beacon.spotlight to just beacon

old birch
#

what

pure radish
#

ok

old birch
#

change these

#

to BEACON.SpotLight.Enabled = true

#

or BEACON.SpotLight.Enabled = false

pure radish
fallen palmBOT
#

studio** You are now Level 3! **studio

old birch
#

is the text also called BEACON?

pure radish
#

yeah

#

i need to change it

old birch
#

yeah

pure radish
#

now its saying this

old birch
#

different script

#

?

pure radish
#

no its the same im pretty sure

#

cause now my button isnt working

old birch
pure radish
#

it has mousebutton1down

old birch
#

and its because u changed the name of the text

#

so u will need to go into that script

#

and edit it so it matches the name of the text

pure radish
#

well thats gone now

#

now its saying this again

old birch
pure radish
old birch
#

the top

#

wiat

#

uh

#

Gui1 is the text right:?

pure radish
#

itself

old birch
#

i think this is meant to be the text

#

right?

pure radish
#

im pretty sure

#

wait

pure radish
#

hopefully this helps too

old birch
#

local BEACON = PLANE.LIGHTS.BEACON

#

?

#

local Gui1= script.Parent

pure radish
#

it doesnt turn on all at when inserted

#

but works when its not inserted