Commands
Understand and create Commands
How Commands Work
Twitch chat messages are received from Tynopia Cloud Services and are built for high-demand streams.
They are server functions, and the server can call the client function.
TriggerClientEvent("tynopia:live:call:functions", source, commandName, ...)
If a threshold is reached, the server will call the server function first, and from there, the client function.
Concept of Channels
Multiple users can be linked to one channel, so if a channel is live, multiple users will receive the same actions of that channel.
A channel is the internal ID of a Twitch account.
All command thresholds will be saved into the database with the channel ID and name as the primary key. This means, because of the concept above, nothing is associated with the user.
Default Commands
Destroy Car
This command destroys the car you're in. If you're not in a car when the threshold is reached, it will wait until you enter one.
It does not matter if you're the driver or a passenger.
The function will make parts of the vehicle broken, dirty, and the controls will be inverted for some time.
Fall
This will ragdoll the player 8 times with different time intervals.
Blind
This will give the player a flashbang effect and blind them for some time.
Magic
This will show some magical effects, and all players will think the affected player is performing magic.
Kill
This makes the player feel uncomfortable and crawl on the floor until they die.
Custom Commands
To create custom commands, you must first register them in functions/server_functions.lua
with the RegisterLiveCommand function.
If you want to use client functions, register them in functions/client_functions.lua
within the Functions
table:
Functions.<command name> = function(<your args>)
<client code here>
end