---A registry of client-side effects. -- Use this to register effects to be called with sv_effects.lua --@client cl_effects.lua --@alias er local log = nrequire("log.lua") local er = {} --master table of effects local effects = {} ---Register an effect. -- Registers an effect that can later be applied to the player --@tparam string name The name of the effect --@tparam function func The function to call when the effect is applied function er.RegisterEffect(name,func) if effects[name] ~= nil then log.warn("Effect \"" .. name .. "\" already registered, replaceing...") end effects[name] = func end er.RegisterEffect("weapon_blocked",function(data) util.ScreenShake( LocalPlayer():GetPos(), 3, 3, 0.25, 100 ) end) net.Receive("art_clienteffect",function() local effectname = net.ReadString() local effectdata = net.ReadData(net.ReadUInt(32)) log.debug("Got effect name",effectname) effects[effectname](effectdata) end) return er