You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurring during loading will trigger an error in the script executing include.
Prototype:
include(path: string)
Parameters:
asset: Path to the file (relative to the current file).
Remarks:
Only scripts registered using RegisterClientScript server-side can be included client-side. If a client script tries to include a non-registered script file it will not be found by the game (independently of the file existence on the dive).
Example code
A simple shared.lua entity using a custom asset
-- Registers the script client-sideRegisterClientScript()
-- Registers box.png as a client-side assetRegisterClientAssets("box.png")
if (CLIENT) thenentity:On("init", function (self)
self:AddSprite({
-- Using the assetTexturePath="box.png"
})
end)
end