Packages > User Events

Name
User Events
Version
2
Tags
scripting
Usage
This package provides a way to interact with user/player local events (like LocalOnButtonPressed) from clients in the world. This package lets you hook into both Local and Server events, through the single on<Event> interface. Just listen to it where you want to hear it. 

Install the package, drag the User Events template onto to the user. To hook into any of the user events, run the following code from anything in the world .

function ExampleScript:ClientInit()
  local user = GetWorld():GetLocalUser()

  user.userEventsScript.properties.onButtonPressed:Listen(self, "ClientHandleButtonPressed")
end

function ExampleScript:ClientClientHandleButtonPressed(btn)
  print("Pressed", btn)
end

Releases

Version 1
- 3 months ago
© 2022 CraytaKit