• Longjump
    1 replies, posted
I've taken my second attempt at making a longjump script. Longjump - Strafing left and right mid-jump repetitively That means that you would need to rotate {+moveright, +right} with {+moveleft, +left} The problem I am having is timing, so I've tried timing this with a think hook. In theory, I would like to have +left and +moveleft in a function that's run off on a think hook. Within this function, I would attempt to run a separate function which negates the first functions actions, and runs the new ones. The problem I run into is the function will not run. [lua]local function LongJamp() RunConsoleCommand("-left") RunConsoleCommand("-moveleft") RunConsoleCommand("+right") RunConsoleCommand("+moveright") end local function LongJump() RunConsoleCommand("-right") RunConsoleCommand("-moveright") RunConsoleCommand("+left") RunConsoleCommand("+moveleft") LongJamp end --This is line 14 local function Enable() hook.Add("Think","LongJump", LongJump) end concommand.Add("+longjump", Enable) local function Disable() hook.Remove("Think","LongJump") end concommand.Add("-longjump", Disable) [/lua] My error is [code] [RunString:14] '=' expected near 'end' [/code] I am doing this in luapad. This is all clientsided.
[lua] local function LongJamp() RunConsoleCommand("-left") RunConsoleCommand("-moveleft") RunConsoleCommand("+right") RunConsoleCommand("+moveright") end local function LongJump() RunConsoleCommand("-right") RunConsoleCommand("-moveright") RunConsoleCommand("+left") RunConsoleCommand("+moveleft") LongJamp() -- I just think you need those two () end --This is line 14 local function Enable() hook.Add("Think","LongJump", LongJump) end concommand.Add("+longjump", Enable) local function Disable() hook.Remove("Think","LongJump") end concommand.Add("-longjump", Disable) [/lua]
Sorry, you need to Log In to post a reply to this thread.