# Callbacks

callbacks are functions that get called whenever something happens ingame\
\
EXAMPLE

<pre class="language-lua"><code class="lang-lua">function onStep()
<strong>      show_message(“hello!!”) -- super annoying popup >:(
</strong>end
</code></pre>

## Start/End

### onCreate()

triggers as soon as lua is finished initialising (dont set song variables in this one! they wont apply)

### onCreatePost()

triggers after obj\_song is created&#x20;

### onSongEnd()

triggers whenever the song ends

## Events

### onStep()

triggers every step event

### onDraw()

triggers every draw event

### onDrawGUI()

triggers every draw gui event

### onBombNote(note: Int)

triggers when a bomb note is hit

### onEventNote(event: Int)

triggers when an event note is hit

### onBadguyNote(note: Int, type: Int)

triggers whenever a note is pressed by the opponent

### onPlayerNote(note: Int, type: Int)

triggers whenever a note is pressed by the player

### onNoteMiss(note: Int, type: Int)

triggers whenever a note is missed

## COMPATIBILITY CALLBACKS

i dont recommend you use these because the names dont really make sense!!

### onStageLoad()

same as **onCreatePost()**

### **onStageDraw()**

same as **onDraw()**

### customChar()

legacy function from when character.lua was required!! just use onCreate lmao
