So before I list off my issue, I just want to say that I have the most basic possible knowledge of LUA, I am currently trying to pick it up multiple different ways, from this forum, to trying to create cool little addons I guess.
So to start of I am making a starwars rp server <-(I understand it’s a very questionable variant of darkrp in many ways.) And decided I wanted to add animations to the playermodels to whenever they primary attacked the animation would play, (With the lightsaber from robotboy, but he did say the lightsaber by itself cannot apply animations so I wen’t with playermodels.) I searched the web for a hook then found an animation function of the garrysmod lua site. I then went into a playermodels lua section and added this.
hook.Add("PlayerBindPress", "Primary attack", function(ply, bind, pressed) if string.find(bind, "+attack1") then self:SetAnimation( phalanx_b_right_t2 ) return true end)
This may or may not look like absolute shit to actual lua developers, but I am just wondering where to go next or where to start if this is completely off track.