#SCriPt

1 messages · Page 1 of 1 (latest)

pulsar zinc
#

SCriPt or "SCP script"

A Lua (Moonsharp) -> LabAPI (SCP:SL) framework providing server administrators more detailed control of their games. No more requesting custom plugins; add your own commands, event handling, coroutines, admin toys, NPCs, run commands, and even write your own plugins in any text editor.

GitHub: https://github.com/tayjay/SCriPt

Latest Release (v0.5.3, LabAPI 1.1.1): https://github.com/tayjay/SCriPt/releases/latest

Documentation (WIP): https://github.com/tayjay/SCriPt/wiki

--

This plugin has been in development for over a year, but recently made a swap from EXILED to LabAPI. The EXILED plugin is not currently being developed; With the addition of LabAPI most functionality should work the same, and removes the need for additional libraries. Please try to read both docs before asking questions. The script format is more similar to actual plugins than approaches I've seen elsewhere.

This plugin is feature-complete, just need to learn how to use it. It has been an invaluable tool for me and I hope someone else will find it useful.

Installation instructions:

  • Download the files SCriPt.LabAPI.dll and dependencies.zip
  • Place the contents of dependencies.zip in your /LabAPI/dependencies/global/ directory
  • Place SCriPt.LabAPI.dll in your LabAPI plugins folder
  • Run the game and check there were no errors in the console
  • Begin writing Lua scripts in the /LabAPI/SCriPt/Scripts/ directory

Example script (welcome.lua):

welcome = SCriPt.Module("Welcome")

function welcome:load()
    Events.Player.Joined.add(welcome.onPlayerJoined)
    print('The Script has loaded!')
end

function welcome:unload()
    Events.Player.Joined.remove(welcome.onPlayerJoined)
end

function welcome:onPlayerJoined(args)
    Server.SendBroadcast('Welcome ' .. args.Player.DisplayName .. ' to the server!')
    print('Welcome ' .. args.Player.DisplayName)
end

Also see Setup.lua

I've heard rumor of similar functionality being added to the base game.

Disclaimer

hasty ravine
#

Scripted events killer 5000 Agree

pulsar zinc
zealous crow
#

@pulsar zinc
[2025-08-06 15:53:06.458 +00:00] [ERROR] [SCriPt.LabAPI] Error loading script he
llo_user.lua: bad argument #1 to 'userdata<SCriPt.LabAPI.Handlers.LuaPlayerEvent
s>.Joined.add' (function expected, got userdata)
hm?

pulsar zinc
zealous crow
zealous crow
#

is it possible to make a similar .stats, like tracking the time of entry, how much time was played on the server, then Kills /Dies and more? If not, it would be cool if you added a similar one.

pulsar zinc
# zealous crow is it possible to make a similar .stats, like tracking the time of entry, how mu...

Hmm, that's an interesting one. Yes that would be possible. There is both a way to create client commands, and store data for later.

I'll be working on documenting that, but as a primer:

stats_command = SCriPt.Command(
    CommandType.Client, --Command Type
    "stats", -- Name
    ["stat"], -- Alternate names
    "Check player stats", -- Description
    "", -- Permission required, blank for this case
    stats_command.execute -- Function to run when called.
)

function stats_command:execute(args, sender)
-- Handle the command here
end


-- Here you can register events to track join, leave, kills, etc.
my_mod = SCriPt.Mod("my_mod")
my_mod.stats = Data.Get("my_stats")
...
-- Initialize user stats
my_mod.stats[args.Player.UserId] = { -- UserId is a unique string for the player.
    last_login = os.time(),
    last_logout = "",
    time_played = 0,
    kills = 0,
    deaths = 0
}

-- Use this to recall the info later
my_mod.stats[args.Player.UserId].kills = my_mod.stats[args.Player.UserId].kills + 1

It's trickier if you want to remain VSR compliant (public server). There is a "DoNotTrack" variable on players that you'll need to check before saving anything about them.

if args.Player.DoNotTrack then
-- Do not save data
  return
end
...

The code above is for example only, will not run on its own

pulsar zinc
#

Doesn't seem to be a good Time tracking function in lua. I'll put that on the feature request list.

zealous crow
#

@pulsar zinc hello, what needs now?
[ERROR] [SCriPt.LabAPI] Error loadin
g script stats.lua: attempt to index a nil value

pulsar zinc
zealous crow
pulsar zinc
zealous crow
#

@pulsar zinc how it fix:
] [ERROR] [SCriPt.LabAPI] Error loadin
g script stats.lua: cannot access field KilledEnemy of userdata<SCriP
t.LabAPI.Handlers.LuaObjectiveEvents>

pulsar zinc
zealous crow
#

oh, okay, ty

zealous crow
#

@pulsar zinc

pulsar zinc
pulsar zinc
#
GitHub

New

Changed plugin loading to split up script loading process.

This will allow for re-adding external dependencies

Added Cassie.* global to interact with C.A.S.S.E. voices
Added Warhead.* globa...

GitHub

A Lua framework for writing SCP:SL plugins. Contribute to tayjay/SCriPt development by creating an account on GitHub.

fleet sky
pulsar zinc
pulsar zinc
#

Back from the dead

Release v0.6.0

https://github.com/tayjay/SCriPt/releases/tag/v0.6.0

See patch notes for changes.

Will be creating a set of prebuilt scripts to add features and make the plugin worth downloading.

GitHub

Updated to LabAPI 1.1.2
To Do: Will update documentation with more example scripts to make adding this plugin better.
Additions

Added events

OnPlayerProcessedJailbirdMessage
OnPlayerProcessingJai...

undone thorn
#

Huh, SE is still trying to redevelop their plugin for LabAPI and this seems like a better solution to do funny things.

pulsar zinc
#

This plugin is more powerful and gives more control than SE, but definitely has a steeper learning curve. Would do better if there was a larger audience for it.

pulsar inlet
#

mmmm competition

pulsar inlet
#

imo that's not that different from learning C#

#

and by then the usefulness of smth like this is low

pulsar inlet
#

se reloaded will put up a fight

pulsar zinc
#

I wrote this plugin in EXILED over the course of about a year on and off, then converted it to LabAPI in a month. They may still have enough interest in the EXILED version to not focus on LabAPI yet.

#

Translating mostly lines up between them except needing to know the new naming conventions (translated a couple plugins) so shouldn't take them too long to transfer if the intent is there

#

Of course, the bigger the mod the more complex and I'm grossly oversimplifying so no hate on the devs

undone thorn
pulsar inlet
#

its buggy rn after its 5th or so rewrite

#

i couldve probably made it stable a long time ago

#

i just like improving the technical side

undone thorn
#

Ping me when you have a stable version, there's a reason i'm dropping plugins from Exiled left and right

pulsar inlet
#

youre on the SE server

#

so if you have the new version ping youll know abt it

pulsar zinc
#

SCriPt 0.7.0

https://github.com/tayjay/SCriPt/releases/tag/v0.7.0

The plugin will now automatically discover all LabAPI Wrappers and Events and make them accessible in Lua. Allows it to keep up to date with the latest API changes without plugin patching.

GitHub

This is an pre-release build. Do not use this on a live server until you know your scripts still execute after updating.
This is a major update to SCriPt and its features. I've done what I can ...