Jump to content

Script Error


Yields

Recommended Posts

This script is server sided and I get this error

[2012-05-22 03:17:52] ERROR: realism-system\s_vehicle_crash.lua:11: attempt to call global 'getLocalPlayer' (a nil value) 

this is the lua code

local vehicle = getPedOccupiedVehicle( getLocalPlayer( ) ) 
  
if getVehicleOccupant( vehicle ) == getLocalPlayer( ) and getVehicleType( vehicle ) == "BMX" then 
    if speed then 
        if getElementModel(vehicle) == 510 then --mtbike 
            if speed >= 60 then 
                toggleControl( "accelerate", false ) 
            else 
                toggleControl( "accelerate", true ) 
            end 
        else 
            if speed >= 45 then 
                toggleControl( "accelerate", false ) 
            else 
                toggleControl( "accelerate", true ) 
            end 
        end 
    end 
end 

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...