#how do i make a script activate after a ui goes away
1 messages · Page 1 of 1 (latest)
** You are now Level 1! **
So u just wanna do something after it goes away?
yeah
Just put a wait and call a function with ur code after it goes away then
where do i put the call
Like u store ur code that u want to run into a function
like i had more knowledge in this about a year ago but i fogot most of it
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
This is simpler; though that could work
Oh wait no
Wouldn't it being client sided affect that?
Unless it's like a boolean in the script
its a one player game
That makes it a lot easier
Then you can just fire an event that sets the value on the server
That's too much lol
barely understand 💔
I'm addicted to remotes 😵💫
U gotta know when to use them correctly
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
Basically for ur case just put all the code u wanna run into a function; then, once the ui goes away call that function after a task.wait
I'm assuming this will be all client sided so only 1 script needed
i think yeah
Lmk if u run into any issues
What do you not understand?
done
You can yeah
It'll still be a function but local is only needed when you are dealing with scoping
so what do i do now
Is this the code to make it disappear or is it supposed to run after it disappears?
to make it disappear
** You are now Level 2! **
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
So is this code in a server script?
wdym
This is the code that makes you fall right?
yeah
It should be server sided
Ok so you will need a remote event
Make one in replicated storage and name it accordingly
i also have a remote event for when the loading finishes
Does the gui go away when it finishes loading?
yes
does it fire to that event when it finishes?
Ok is this in a local script?
yeah
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
what do you mean before
an entire line before it?
or in the same line