In my Lua script, I need to make it so it changes your material whenever you move. However, my current method, changes the material when you press any movement-related buttons and is not very good.
if key == IN_FORWARD or key == IN_BACK or key == IN_MOVELEFT or key == IN_MOVERIGHT or key == IN_JUMP then self:SetMaterial( "models/effects/comball_tape" ) else self:SetMaterial( "sprites/heatwave" ) end
Is there anyway I can do “if ply:IsMoving() then” or anything like that? I’ve checked the wikis and could not find anything.