Slow Firing AK

Hi, I was wonder how would I make the host_timescale 0.4 ONLY when the owner is firing?

[lua]function SWEP:PrimaryAttack()
game.ConsoleCommand( “host_timescale 0.4” )
end[/lua]

You mean like that?

Unless you want the timescale to be on 0.4 until you manually switch it back, this isn’t a good idea.

[editline]06:41PM[/editline]

Also, timescale isn’t a valid Console Command, you are looking for phys_timescale or host_timescale.

Wasn’t sure what the concommand was or when he wanted it, but I think he was going for the hook name. Although he could be asking for an external script acting on the default weapon_ak47.

host_timescale is a cheat and affects everything. There’s no surefire way unless you use physical bullets.

should of been more specific, it’s host_timescale that i was talking about
and i was going to put this in an ak swep

i was doing this for a pack of guns that shoots in slomo, in response to my dramatic gun, but i thought it was stupid and pointless, i might start again.

oh and did you use motion blur with your gun?

I would suggest something along the logic of.

[lua]

This isn’t code it’s an idea.

if not SWEP:PrimaryAttack()

game.ConsoleCommand(“host_timescale 1.0”)

end

[/lua]

Hope this helps.

Thanks for that, and yes I did use motion blur. Thanks for that my code too, I might try again, buy would that solve how long, I know it’s just an idea.

So…combine what entoros did with that?

how would you add the if-the-primary-fire-isn’t-on-then-change-host_timescale part?

We’re not going to write the code for you, I suggest you look at the lua tutorials before YOU begin to script this.

so would it be



if function SWEP:PrimaryAttack()  
    game.ConsoleCommand( "host_timescale 0.4" )  
else game.ConsoleCommand( "host_timescale 1" )
end  

?

I suggest you read how to program in Lua before trying to code blindly.

but i cant find the function for it.

CHALENGE!!! this was always unevitable but maybe we could MAKE the function ofcourse needing physical bullets?

The only good physical bullets i seen were in smod.

Btw could I use the function “if not?”

help?