Jump to content

How To Create Speedboosts?


plantanium

Recommended Posts

Make a new txt file. Copy in this code. Click on Save As. Yourname.lua

Open the meta file in notepad and write in

<script src="Yourname.lua" type="client" /> 

Just works when you are making a race map (DM,DD,Race)

You have to test with race too. Not working if you just press F5.

Change the X,Y,Z to your cords.

You can change the

Multiplier = 1.5 

how much you want. (Dont go higher then 5.0)

Do not change anything under

fuction SpeedBoost (player) 

function start() 
    SpeedBoost = {   
                createMarker (X,    Y,  Z,        "corona",       5,    60,     255,    100,    255 ), 
            }                                                         
  
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), start ) 
                                   
  
Multiplier = 1.5 
  
function SpeedBoost (player) 
    if player ~= getLocalPlayer() then return end 
    if getElementType(player) == "player" then 
        if isPedInVehicle ( player ) then 
            local car = getPedOccupiedVehicle(player) 
            if getVehicleController(car) == player then 
                speedx, speedy, speedz = getElementVelocity ( car )  
                speedcnx = (speedx*Multiplier) 
                speedcny = (speedy*Multiplier) 
                speedcnz = (speedz*Multiplier) 
                setElementVelocity ( car, speedcnx, speedcny,speedcnz ) 
                fixVehicle(car) -- fixes the vehicle 
                playSoundFrontEnd(46) 
            end 
        end 
    end 
end 
addEventHandler ( "onClientMarkerHit", getResourceRootElement(getThisResource()), SpeedBoost ) 

Link to comment

coordinates are entered here what you need.

  
function start() 
    SpeedBoost = { 
        createMarker (-1797,    -1880,          490,            "corona",   5,  60,     255,    100,    105 ), 
        createMarker (-1797,    -1880,          490,            "corona",   5,  60,     255,    100,    105 ), 
        createMarker (-1797,    -1880,          490,        "corona",   5,  60,     255,    100,    105 ), 
        createMarker (-1797,    -1880,          490,            "corona",   5,  60,     255,    100,    105 ), 
        createMarker (-2367.9,  -1752.2,    485,            "corona",   5,  60,     255,    100,    105 ), 
        createMarker (-2367.9,  -1752.2,    485,            "corona",   5,  60,     255,    100,    105 ), 
        createMarker (-2375.3,  -1724.3,    499.2,          "corona",   5,  60,     255,    100,    105 ), 
        createMarker (-2375.3,  -1724.3,    520,    "corona",   5,  60,     255,    100,    105 ), 
        createMarker (1977.36,  -1286.72,   245.344,    "corona",   5,  60,     255,    100,    105 ), 
        createMarker (1790.89,  -1631.36,   195.339,    "corona",   5,  60,     255,    100,    105 ), 
        createMarker (1470.72,  -1623.86,   200.364,    "corona",   5,  60,     255,    100,    105 ), 
        createMarker (1332.67,  -1548.88,   246.432,    "corona",   5,  60,     255,    100,    105 ), 
        createMarker (1702.74,  -1351.29,   130.889,    "corona",   5,  60,     255,    100,    105 ), 
        createMarker (1099.04,  -1541.56,   192.859,    "corona",   5,  60,     255,    100,    105 ), 
        createMarker (1542.42,  -1183.14,   184.604,    "corona",   5,  60,     255,    100,    105 ), 
        createMarker (1373.26,  -1178.31,   288.364,    "corona",   5,  60,     255,    100,    105 ), 
    }                                                         
  
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), start ) 
                                    
Multiplier = 1.5  
function SpeedBoost (player) 
    if player ~= getLocalPlayer() then return end 
    if getElementType(player) == "player" then 
        if isPedInVehicle ( player ) then 
            local car = getPedOccupiedVehicle(player) 
            if getVehicleController(car) == player then 
                speedx, speedy, speedz = getElementVelocity ( car )  
                speedcnx = (speedx*Multiplier) 
                speedcny = (speedy*Multiplier) 
                speedcnz = (speedz*Multiplier) 
                setElementVelocity ( car, speedcnx, speedcny,speedcnz ) 
                fixVehicle(car)  
                addVehicleUpgrade(car, 1010) 
                playSoundFrontEnd(46) 
            end 
        end 
    end 
end 
addEventHandler ( "onClientMarkerHit", getResourceRootElement(getThisResource()), SpeedBoost ) 
  

in meta.xml

  
 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...