#how do i make a script activate after a ui goes away

1 messages · Page 1 of 1 (latest)

clever shore
#

i have a loading screen ui, and i want to make it so that when it goes away, a wait timer happens, and then the "fall" script activates

quiet hatchBOT
#

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

clever shore
#

its simple and all im just new to scripting

median eagle
#

So u just wanna do something after it goes away?

clever shore
#

yeah

median eagle
#

Just put a wait and call a function with ur code after it goes away then

clever shore
#

where do i put the call

median eagle
#

Like u store ur code that u want to run into a function

clever shore
#

like i had more knowledge in this about a year ago but i fogot most of it

shell echo
#

why cant you just add a value thats set to if its loaded or not

#

and when it loads you set the value to true

median eagle
shell echo
#

then you can do Value.changed

#

and boom

median eagle
#

Oh wait no

median eagle
#

Unless it's like a boolean in the script

clever shore
#

its a one player game

shell echo
#

That makes it a lot easier

#

Then you can just fire an event that sets the value on the server

median eagle
#

That's too much lol

clever shore
#

barely understand 💔

shell echo
#

I'm addicted to remotes 😵‍💫

median eagle
#

In this scenario you wouldn't even need a remote

#

If ur gonna use an event you would do a bindable

#

But I mean atp just throw it all into 1 script

median eagle
#

I'm assuming this will be all client sided so only 1 script needed

clever shore
#

i think yeah

median eagle
#

Lmk if u run into any issues

clever shore
#

ill try my best, i understoon like 50% of what you said

#

but thank you anyway

median eagle
#

What do you not understand?

clever shore
#

so is it like this to put it into a function

median eagle
#

That'll work yeah

#

But you only add the local when it's inside another function

clever shore
#

done

median eagle
#

You can yeah

#

It'll still be a function but local is only needed when you are dealing with scoping

clever shore
#

so what do i do now

median eagle
#

Is this the code to make it disappear or is it supposed to run after it disappears?

clever shore
#

to make it disappear

quiet hatchBOT
#

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

clever shore
#

it makes you fall into a pit

#

okay so basically, after the game loads in - which there is a loading screen - the loading screen fades away, and then you fall into the pit

#

i just dont know how to make the fall thing activate after the loading screen goes away

median eagle
#

So is this code in a server script?

clever shore
#

wdym

median eagle
#

This is the code that makes you fall right?

clever shore
#

yeah

median eagle
#

It should be server sided

clever shore
#

yeah i think it is

#

its a one player game so no point in it being client sided

median eagle
#

Ok so you will need a remote event

#

Make one in replicated storage and name it accordingly

clever shore
#

i also have a remote event for when the loading finishes

median eagle
#

Does the gui go away when it finishes loading?

clever shore
#

yes

median eagle
#

does it fire to that event when it finishes?

clever shore
median eagle
#

Ok is this in a local script?

clever shore
#

yeah

median eagle
#

Ok so at the bottom before the enabled you'll want to fire to the server with the event

#

Something like RemoteEvent:FireServer()

#

Then on ur fall script receive that event and connect it to the function

clever shore
#

an entire line before it?

#

or in the same line

median eagle
#

You change a boolean

#

So before that changes

#

After the loading visuals finish

clever shore
#

like that?

#

im a big noob i barely understand things lmao

#

@median eagle i can play you 50 robux ;-;

clever shore
#

nvm i did it

#

im actually so proud of myself