SCriPt v0.3.0
Pre-release
Pre-release
Major Changes
Scripts Directory
- Script loading structure has changed.
- All scripts in the Scripts directory, other than those in the "Globals" subdirectory are now loaded on startup recursively.
- Any scripts in subdirectories like
AutoLoadwill work as expected.
- Any scripts in subdirectories like
- Scripts now all load on plugin startup into their own containers
- No more "AutoLoad" script
- This is to increase security and allow for easier expansion of the plugin
- Wiki has been updated to reflect the change
Config Changes
- Make sure to regenerate the "s_cri_pt > script_path config option to allow the new script loader to function correctly.
Backend Changes
- Changed how a script is loaded to more easily keep track of its lifecycle.
- Coroutines, Command, and other objects a script creates are now tracked independently, and can be removed cleanly when a script is unloaded.
Enums
- Enum types are now registered for scripts
- This means that functions that used to values like player role will now use C# enum syntax rather than name
Player:SetRole("ClassD")is nowPlayer:SetRole(RoleTypeId.ClassD)
- Information on some of these Enums can be found in the EXILED documentation
EXILED Custom Items support
Starting to work on adding support for registering custom items within Lua. This implementation is still WIP.
Creating a script with the following content will create a custom gun:
custom_gun ={
firearm_type='Com15',
name='CustomCom15',
description='It's a custom gun',
weight='1',
damage='100'
}
function custom_gun.OnShooting(args)
print('Shooting')
args.IsAllowed=false
endNew Pastebin Implementation
- The
Pastebinglobal has been removed. - There is now a new process to load scripts from Pastebin
- Create a new file in the same directory as your other scripts.
- Name the file with the name of the link you wish to reference and the file extension
.pastebin - Example:
KUJHSZM2.pastebin(This will load theSkeletonCommand.luaexample file https://pastebin.com/KUJHSZM2)
- When the server starts it will download the script, in this example to
KUJHSZM2.lua, and execute it like any other - Changes can be made to this lua file as you wish
- If you'd like to revert to the original script, or if a new version of that pastebin has been updated:
- Delete the generated
.luafile. - The existing
.pastebinfile will automatically redownload it.
- Delete the generated
- Saving the script and not downloading on every load will accomplish the following
- Reduce network usage
- Reduce impact if the original pastebin is tampered with
- Allow for customization of the downloaded scripts.
Minor Changes
- Added
Events.Warhead.*events handler - Added
Facility.Seedvariable - Added
Lobby.TimeLeft - Added a
Newglobal to scripts- Allows creating some new structs
New.Vector3(x,y,z),New.Color(r,g,b,a)
Storewill no longer automatically save, if you make a change you are responsible for saving it- Was taking a lot of resources when not in use.
- For
Playerobjects- Added methods to enable, disable, and check on player effects by
EffectTypeenum - Can now set role based on
RoleTypeIdenum - Get and set a player's
ScpTickets - Get a player's
DoNotTrackstatus UseHeldItemandUseItem(ItemType)methods for forcing interaction with itemsMovementStatevariable of typePlayerMovementStateto get and set how a player is movingEnableFallDamageget and set- Added method
CheckPermission(String)to see if the player has a specific EXILED permission
- Added methods to enable, disable, and check on player effects by
- Server Events
- Added
SelectingRespawnTeamevent
- Added