greentumbleweed Posted March 8, 2021 Share Posted March 8, 2021 (edited) I'm not sure the math on this, but I'm trying to make the velocity not drain as fast. However this is making it continually gain speed. vV = "w" iK_v = 1.02 -- inertia power sK_t = 50 Xperimental = true local sorc = getLocalPlayer() addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function(resource) bindKey(vV, "both", _coref_) end ) function _coref_(key, state) local veh = getPedOccupiedVehicle(sorc) if (veh) then if (getVehicleController(veh) == sorc) then if key == vV then if state == "up" then if Xperimental then cT3 = getTickCount() end sT = setTimer(function() local xs, ys, zs = getElementVelocity(veh) setElementVelocity(veh, xs*iK_v, ys*iK_v, zs*iK_v) end, sK_t, 0) elseif state == "down" then return end killTimer(sT) end end end end end Edited March 8, 2021 by greentumbleweed Link to comment
Tekken Posted March 8, 2021 Share Posted March 8, 2021 Decrease iK_v each time the script runs ? Until it becomes 0 and then stop? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now