[WIP] Helicopter start Script

Hey Everyone Here is something i’m sure many people have been trying to figure out and i have found some stuff about it. Beta Testing is not required atm.

Current Features List:

  • Slow Helicopter Blade on startup [5/100 Finished]
  • keybindings for startup options [0/100 Finished]

Any suggestions will be great

-Rhys19

Discord Server (discord server for more information)

1 Like

Seems like a cool idea :slight_smile: Someone else asked me to make one but I never got time to do it. Good to see someone else decided to make it instead :mascot:

1 Like

yup i’ve been wanting it to but could never find it you can be a beta tester if you want or contributor! you seem like a good contributor because i’ve seen your scripts!

EDIT: also which discussion do i add it to (category wise) to remove the resolved mark?

This category should be fine. The checkmark will stay in this category though that shouldn’t really matter.

Thanks, however like I said in my previous post: I’m sort of very busy. Currently working on my own big project so won’t have any time available anytime soon :no_mouth:

that’s fine. if you do indeed to contribute let me know! cheers!

i cannot figure this out!

client.lua:

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
	SetHeliBladesSpeed(vehicleHandle, 0.1f);
	end
end)

it isn’t working
it starts up normally not how i want it i even tried

SetHeliBladesSpeed(vehicleHandle, 0.0f);

&

SetHeliBladesSpeed(vehicleHandle, 1.0f);

Have you tried it without the f after 0.1 and without the ; after SetHeliBladesSpeed(vehicleHandle, 0.1)

Because that looks to me as if you’re mixing up lua and c#.

well i thought it would be based on this: https://runtime.fivem.net/doc/reference.html#_0xFD280B4D7F3ABC4D

also i tried it without the f 0.1 and ; but it still wont change the helicopter speed

Works fine for me… Not sure what you’re doing wrong.

function ShowText(text, justification, color, posx, posy, size)
    SetTextFont(4)
    SetTextScale(1.0, size)
    SetTextJustification(justification)
    SetTextColour(table.unpack(color))
    SetTextOutline()
    BeginTextCommandDisplayText("STRING")
    AddTextComponentSubstringPlayerName(text) 
    EndTextCommandDisplayText(posx, posy)
end

Citizen.CreateThread(function()
    local speed = 0.05
    while true do
        Citizen.Wait(0)
        SetHeliBladesSpeed(GetVehiclePedIsIn(PlayerPedId(), false), speed)
        if IsControlJustPressed(0, 172) then
            speed = speed + 0.05
        elseif IsControlJustPressed(0, 173) then
            speed = speed - 0.05
        end
        if speed > 1.0 then speed = 1.0 end
        if speed < 0.0 then speed = 0.0 end
        ShowText(tostring(speed), 1, {255,255,255,255}, 0.5, 0.5, 0.5)
    end
end)
return "Done"

video preview:

i tried your code but what button are using it to control the speed?

controller, dpad-up and dpad-down. Pretty sure it’s arrow-up and arrow-down on keyboard (phone inputs)

i’ve tried the arrow up and down on keyboard not working but i will try controller and see

Are the controls disabled by any chance by another script? as that’d obviously conflict with my code snippet. You can also just change codes or use commands if you want to manually set a specific speed for testing. Just did this very quickly.

i’ll check

(20char’ssuck)

edit: also when i restart the script it restarts the engine but makes the heli speed slow. then it boots up

nvm i figured it out i just removed the text part of it and it worked now to make it so it will start up slowly when you turn the engine on :slight_smile:

1 Like

hmm i abviously can’t figure that out either :frowning:
thought maybe this would work but no:

Citizen.CreateThread(function()
    local speed = 0.05
    while true do
        Citizen.Wait(0)
        SetHeliBladesSpeed(GetVehiclePedIsIn(PlayerPedId(), false), speed)
        if GetIsVehicleEngineRunning then
            speed = speed + 0.05
        if IsVehicleEngineStarting then
            speed = speed - 0.05
        end
        if speed > 1.0 then speed = 1.0 end
        if speed < 0.0 then speed = 0.0 end
    end
end)

is vehicle engine starting only gets triggered for a very short time. Besides, having the delay set to 0 (which is required because you need to set the blades speed each tick) means the speed being increased with 0.05 each time, only takes 20 frames to go up to full speed, but as “IsEngineStarting” only returns true for a short time, it won’t work.

1 Like

oh do you know anything else that might work? i’m open for suggestions! because i’m sure many people have been wanting this and i will also credit you for helping me :slight_smile:

This still getting worked on?