R_Slasher
r_slasher Exports
r_slasher client and server exports: check if a player is in a Slasher Night round, read their role and lobby.
Client exports
local inRound = exports.r_slasher:IsInSlasher() -- true while in a round
local role = exports.r_slasher:GetRole() -- 'killer' | 'survivor' | nilRegisterCommand('phone', function()
if exports.r_slasher:IsInSlasher() then return end
OpenPhone()
end)Server exports
local inRound = exports.r_slasher:IsPlayerInSlasher(source)
local lobby = exports.r_slasher:GetPlayerLobby(source)
-- { id = 'stabcity', kind = 'public', label = 'Stab City', map = 'stabcity', players = 4, state = 'playing' } or nilRewards
Use the hooks in server/sv_custom.lua to give XP, items or achievements:
function OnSurvivorEscaped(src, lobby)
end
function OnRoundFinished(lobby, round, results)
-- results[src].role, .won, .reward, .batteries, .rescues, .eliminations
endAll hooks are listed on Configuration.