How do i fix this

The code


addhook("ThinkFrame",function ()
for players in players.iterate do
if player.mo.skin == "sonic" then
continue
end

If not (player.cmd.buttons & BT_CUSTOM1) then

--var stuff

If P_IsObjectOnGround (player.mo) and player.Boosttapping and player.Boosting == 1 then

player.mo = FixedMul+x (FRACUNIT+100)

The last part(FixedMul part) is fixed on the laptop

Please help

Also i made this myself

Help me fix this
Post automatically merged:

Im on android
 
First off, let's start by correcting the syntax in the code - proper indenting and better function definitions.
Corrected syntax:
addhook("ThinkFrame", function() -- "do" would be better here, but your choice
    for players in players.iterate do
        if player.mo.skin == "sonic" then
            continue
        end

        if not (player.cmd.buttons & BT_CUSTOM1) then

            --var stuff

            If P_IsObjectOnGround (player.mo) and player.Boosttapping and player.Boosting == 1 then

                player.mo = FixedMul+x (FRACUNIT+100)
The code doesn't really make sense to the program with what you wrote... Lemme rewrite it rq
Rewritten code:
addhook("ThinkFrame", function() -- "do" would be better here, but your choice
    for players in players.iterate do
        if not (player.mo.skin == "sonic") then -- Use "not" when wanting to make sure to do stuff if the condition is NOT true
            continue
        end

        if player.cmd.buttons & BT_CUSTOM1
            if not player.boostTapping then -- better boost tap check
                if P_IsObjectOnGround(player.mo) and not player.boosting then
                    player.boosting = true -- Booleans would be better here
                elseif player.boosting -- better midair check
                    player.boosting = false
                end
            end
            player.boostTapping = true
        else
            player.boosting = false
            player.boostTapping = false
        end
       
        if player.boosting
            P_InstaThrust(player.mo, player.drawangle, 100*FRACUNIT) -- This is the function you need here
        end
    end
end)
 
Thx man
Post automatically merged:

Also -- Var stuff is not a comment
Post automatically merged:

And ......... it dosent seem to work
Post automatically merged:

Oh wait it was just a syntax error
 
Last edited:
Hey man sorry for not saying anything for like many hours (i was sleeping)

Var stuff means that in that section of the code there were variables (booleans or true and false variables)
Post automatically merged:

Hey man sorry for not saying anything for like many hours (i was sleeping)

Var stuff means that in that section of the code there were variables (booleans or true and false variables)
I'm sorry ;-;
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top