Setting up controls
2
Create control
-- Here is an example of a new control
--[[ W + CTRL FUNCTION (Speed Boost) ]]--
{
firstControl = 71, -- W
secondControl = 36, -- CTRL
action = 9, -- Optional: assign any predefined action ID
maxSpeed = 45, -- Maximum speed in km/h during this boost
callback = function()
local ply <const> = PlayerPedId()
if not holdingBoost then
holdingBoost = true
Citizen.CreateThread(function()
ClearPedTasks(ply)
-- Optional animation for the boost (can be changed)
TaskPlayAnim(ply, "move_m@brave", "run", 5.0, 8.0, 1500, 0, 0, false, false, false)
-- Apply a velocity boost to the skates entity
local velocity = GetEntityVelocity(Skates.Entity)
SetEntityVelocity(Skates.Entity, velocity.x * 1.4, velocity.y * 1.4, velocity.z)
-- Prevent spam by adding a short cooldown
Citizen.Wait(1000)
holdingBoost = false
end)
end
end
},

Last updated