Hi, i am pretty new to lua and i am trying to create a little addons for fun. The problem i have is for some reason the function seems to repeat itself 2 to 3 times. I dont really understand predicted hooks and i was wondering if anyone could help. Here is the code i have done so far
function HolsterToBack( ply, oldWeapon, newWeapon ) ply:ChatPrint( "You switched weapons! Your old weapon is " .. oldWeapon:GetClass() .."." ) ply:ChatPrint( "Your new weapon is " .. newWeapon:GetClass() .. "." ); end hook.Add("PlayerSwitchWeapon","HookHolsterToBack", HolsterToBack)
Thanks for helping me and have a good day.
Sorry for my bad english.