UltEvents - Lakatrazz/BONELAB-Fusion GitHub Wiki
The Fusion SDK has many UltEvent scripts that allow you to run logic whenever a certain event happens.
If you do not know how to use UltEvents, I recommend these unofficial docs.
Server Events
The Server Events script lets you detect when a server is joined, when a server is left, and if the local player is the host. Let's look at it in the editor:
- On Server Joined Holder
- This UltEventHolder will be invoked when the user joins a server.
- On Server Left Holder
- This UltEventHolder will be invoked when the user leaves a server.
The script also has values you can check from your own UltEvent. This includes the following:
- Has Server
- Returns True if the user is currently in a server, False otherwise.
- Is Host
- Returns True if the user is the host of the server, False otherwise.
You can also use these bools in UltEvent conditional statements for more advanced logic.
Ownership Events
Every synced object in Fusion has an "owner", including the players. The owner is who controls the syncing of that object, usually changed by the object being interacted with. Using Ownership Events, you can detect when the local player gains or loses ownership of an object. Let's look at it in the editor:
- On Ownership Gained Holder
- This UltEventHolder will be invoked when the user gains ownership of the object.
- On Ownership Lost Holder
- This UltEventHolder will be invoked when the user loses ownership of the object.
The script also has values you can use to check the current ownership of the object:
- Is Owner
- Returns True if the user currently owns this object.
Gamemode Events
The Gamemode Events script can be used to detect when a Gamemode is started or stopped. Let's look at it in the editor:
- On Gamemode Started Holder
- This UltEventHolder will be invoked when a Gamemode starts.
- On Gamemode Stopped Holder
- This UltEventHolder will be invoked when the Gamemode stops.
Celebration Events
The Celebration Events script lets you detect when certain special events are occurring, such as Fusion's birthday. Let's look at it in the editor:
- On Mod Birthday Holder
- This UltEventHolder will be invoked when it is near Fusion's birthday.