Jump to content

[HELP] wheel is turned when getting out of the car


DAKAN'

Recommended Posts

function radExit() 
local Vehicle = getVehicleController(source) 
local radLinks, radRechts = getVehicleComponentRotation(Vehicle, "wheel_lf_dummy"), getVehicleComponentRotation(Vehicle, "wheel_rf_dummy")  
setVehicleComponentRotation(Vehicle, radLinks) 
setVehicleComponentRotation(Vehicle, radRechts) 
    end 
addEventHandler("onVehicleExit", getRootElement(), radExit) 
  
  
  
function radEnter() 
   setVehicleComponentRotation(Vehicle, radLinks) 
   setVehicleComponentRotation(Vehicle, radRechts) 
 end 
addEventHandler("onVehicleEnter", getRootElement(), radEnter) 
  
  
  
  
function radRespawn() 
setVehicleComponentRotation(Vehicle, radLinks) 
setVehicleComponentRotation(Vehicle, radRechts) 
   end 
addEventHandler("onVehicleRespawn", getRootElement(), radRespawn) 

Does anyone know what's wrong with this script? 

 

 

Link to comment

remove local from radlinks and radrechts in your function

local radLinks, radRechts

function radExit() 
	local Vehicle = getVehicleController(source) 
	radLinks, radRechts = getVehicleComponentRotation(Vehicle, "wheel_lf_dummy"), getVehicleComponentRotation(Vehicle, "wheel_rf_dummy")  
	setVehicleComponentRotation(Vehicle, radLinks) 
	setVehicleComponentRotation(Vehicle, radRechts) 
end 
addEventHandler("onVehicleExit", getRootElement(), radExit) 

 

Link to comment
1 hour ago, Tails said:

remove local from radlinks and radrechts in your function


local radLinks, radRechts

function radExit() 
	local Vehicle = getVehicleController(source) 
	radLinks, radRechts = getVehicleComponentRotation(Vehicle, "wheel_lf_dummy"), getVehicleComponentRotation(Vehicle, "wheel_rf_dummy")  
	setVehicleComponentRotation(Vehicle, radLinks) 
	setVehicleComponentRotation(Vehicle, radRechts) 
end 
addEventHandler("onVehicleExit", getRootElement(), radExit) 

still did not work 

 

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