[CODE]function SWEP:IsReloading()
local vm = self.Owner:GetViewModel()
if vm:GetSequence() == string.find(vm:LookupSequence(),"reload") and (math.Round(vm:GetCycle()*100) < 100) then
return true
end
return false
end[/CODE]
im trying to make the function return true whenever the viewmodel's current sequence name has "reload" in it, and its just giving me errors.
Maybe post the errors?
That's not how comparisons work. Use
[code]local seqName = vm:GetSequenceName( vm:GetSequence() )
if ( seqName and string.find( string.lower( seqName ), "reload" ) then[/code]
[QUOTE=code_gs;49111410]That's not how comparisons work. Use
[code]local seqName = vm:GetSequenceName( vm:GetSequence() )
if ( seqName and string.find( string.lower( seqName ), "reload" ) then[/code][/QUOTE]
That helped, thanks
[editline]13th November 2015[/editline]
[QUOTE=Robotboy655;49111393]Maybe post the errors?[/QUOTE]
It was an issue with calling vm:LookupSequence() with nothing inside the ()
Sorry, you need to Log In to post a reply to this thread.