• Adding toggleable things.
    5 replies, posted
So how would someone go about doing something like: [lua]function SWEP:Think() if self.Owner:KeyPressed(IN_RELOAD) then RunConsoleCommand("host_timescale", "0.2") [/lua] And making it so that the second time I press the reload key, it goes back to 1? Also, can you not just give me the code and instead hint at how to do it. P.S. I have no idea on datatables, USMGs, or NWBools.
[QUOTE=Flubadoo;25063935]So how would someone go about doing something like: function SWEP:Think() if self.Owner:KeyPressed(IN_RELOAD) then RunConsoleCommand("host_timescale", "0.2") And making it so that the second time I press the reload key, it goes back to 1? Also, can you not just give me the code and instead hint at how to do it. P.S. I have no idea on datatables, USMGs, or NWBools.[/QUOTE]There are allot of ways to do that.. The easiest would be to check if the "host_timescale" is not 0.[LUA]function SWEP:Think() if self.Owner:KeyPressed(IN_RELOAD) then if GetConVarNumber("host_timescale") == 0.2 then RunConsoleCommand("host_timescale", "1") else RunConsoleCommand("host_timescale", "0.2") end end end[/LUA]Untested, but should work. Also, stop asking other people to do your work.
[QUOTE=Flubadoo;25063935]Also, can you not just give me the code and instead hint at how to do it.[/QUOTE] [QUOTE=freemmaann;25064153]Also, stop asking other people to do your work.[/QUOTE] :colbert:
Well I think that you should've left it at if host_timescale aint 0. But thanks anyways. [editline]06:02PM[/editline] Ninja'd :ninja:
[QUOTE=c-unit;25064937]:colbert:[/QUOTE] I read it wrong to:tinfoil: [QUOTE] Also, can you just give me the code instead of hinting at how to do it. [/QUOTE] That's what I read the first time.
[QUOTE=ralle105;25075846]I read it wrong to:tinfoil: That's what I read the first time.[/QUOTE]I kinda feel a little bit bad about flaming at the guy cause of my bad reading. :/
Sorry, you need to Log In to post a reply to this thread.