Skip to content

Instantly share code, notes, and snippets.

@ValentinFunk
Created October 11, 2017 14:34
Show Gist options
  • Select an option

  • Save ValentinFunk/1981e461e93d4e68425d0721665551ef to your computer and use it in GitHub Desktop.

Select an option

Save ValentinFunk/1981e461e93d4e68425d0721665551ef to your computer and use it in GitHub Desktop.
Mixin demonstration for PS2 (place in addons/ps2_customization/lua/ps2/server
local TrailcheckerMixin = {}
function TrailcheckerMixin:included( klass )
local oldThink = klaas.Think
klass.Think = function(self)
oldThink(self)
if IsValid(self.trailEnt) then
local shouldDraw = hook.Run("PS2_VisualsShouldShow", self:GetOwner()) == false
self.trailEnt:SetNoDraw(not shouldDraw)
end
end
end
Pointshop2.RegisterItemClassMixin( "base_trail", TrailcheckerMixin )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment