Models and sounds from the s&box cloud
Every public model and sound on sbox.game can be used by a plugin through its package name
(facepunch.present_box, igrotronika.coin1…). The server mounts it and the players download it when they join,
as s&box does for maps. Packages only bring content: models, materials, sounds, never code.
| Helper | Does |
|---|---|
UsePackage( "org.package" ) |
Mount a package on the server now (call it in OnLoaded), so players get it while they join |
SpawnProp( asset, position, yaw, solid ) |
Place an object: asset is a model package or a model path of the game. It appears on every player’s screen as soon as the model is loaded, with a collision if solid. It is removed when the plugins restart and is not saved with the world: keep its positions in your data. Returns its GameObject |
RemoveProp( prop ) |
Remove an object this plugin placed |
PlaySound( asset, position ) |
Play a sound for every player: a sound package or a .sound path of the game |
Find packages on sbox.game (models and sounds), or with the Package.FindAsync search of s&box. Mind their size:
every player downloads them.
On a player (RustPlayer): DisplayName, SteamId, Health, IsDead, WorldPosition,
Teleport( position ) (a driver gets out of his car first), Notify( text ) (popup), Inventory (Clear(), Give(...), Count(...)), Heal( amount ).
These names, the hooks and the helpers are the plugin API. The rest of the game is reachable too (every public class), but it can change from one update to the next without notice: plugins that stay on the API keep working.