This question may be stupid; the answer may be staring me in the face or it may be complicated - Honestly, I don't know.
So, I have made a GUI script in a local script inside of one of the GUIs inside of StarterGUI
I have also made a normal script which lives inside of ServerScriptService.
The normal script is the main script for the game and is all inside one loop -while true do
In the local GUI script I have programmed a GUI to pop up
I want the GUI to pop up at a certain time in the main script
How would I do that?
I have tried making a global function inside the GUI script and then calling the function inside the main script, but it gives me the error: attempt to call field 'Pizza' (a nil value)
(yes, I named my function Pizza)
I also tried making an if statement and making the condition true in the main script so that the GUI script would trigger when the condition was true but it simply didn't work -no errors.
There are no errors within the main script itself and there are no errors within the GUI script itself It just doesn't work when I try connecting the scripts in any way.
I hope everything I said makes sense.
Thanks, xAdeline
Always look for the wiki page that has what you're looking for.
In the server script:
re = Instance.new("RemoteEvent", workspace) re.Name = "GuiTrigger" -- Try a different name -- In a different script re:FireClient(game.Players.SebbyTheGODKid)
In the GUI script:
re = workspace:WaitForChild("GuiTrigger") re.OnClientEvent:connect(function() -- My code here... print("my remote event got fired!") end)