Hello! The “PrimarySignalEvent” will not allow you to sleep. You are definity going the the right direction creating another function “OnRemoteClicked”. Although OnRemoteClicked is not getting called.
IF you want to call a function that sleeps from an event. You need to use “spawn{FunctionThatSleeps}”
So, try this:
using {/Fortnite.com/Characters}
using {/Fortnite.com/Playspaces}
using {/Fortnite.com/UI}
using {/UnrealEngine.com/Temporary/SpatialMath}
using {/UnrealEngine.com/Temporary/Diagnostics}
using {/UnrealEngine.com/Temporary/UI}
using {/Verse.org/Simulation}
using {/Verse.org/Random}
using {/Fortnite.com/Devices}
using {/Verse.org/Simulation}
Shop_Remote := class(creative_device):
@editable RemoteManager : signal_remote_manager_device = signal_remote_manager_device{}
@editable Hud_Message : hud_message_device = hud_message_device{}
@editable Teleporter : teleporter_device = teleporter_device{}
OnBegin<override>()<suspends>:void=
RemoteManager.PrimarySignalEvent.Subscribe(OnRemoteClicked)
# cannot use sleep in here, so we use spawn{} instead!
OnRemoteClicked(Agent: agent): void =
spawn{TeleportToLobby(Agent)}
TeleportToLobby(Agent : agent) <suspends> : void =
Sleep(3.0) # call sleep in the function tagged <suspends>
Teleporter.Teleport(Agent)