Created
October 11, 2017 14:34
-
-
Save ValentinFunk/1981e461e93d4e68425d0721665551ef to your computer and use it in GitHub Desktop.
Mixin demonstration for PS2 (place in addons/ps2_customization/lua/ps2/server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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