dsmatias Posted November 3, 2016 Share Posted November 3, 2016 Error, Help? Line: if curGear > lastGear then playBlowoffSound(vehicle) end if downgrading then if ( lastRPM < rpm and ( lastGear <= curGear ) ) or lastGear < curGear then if isTimer ( downgradingTimers[1] ) then killTimer ( downgradingTimers[1] ) end if isTimer ( downgradingTimers[2] ) then killTimer ( downgradingTimers[2] ) end downgrading = false end local temprpm = interpolateBetween ( downgradingRPM[1], 0, 0, downgradingRPM[2], 0, 0, downgradingProgress, "Linear" ) setSoundSpeed ( sound, temprpm/vehiclesSounds[model].coeff ) else setSoundSpeed ( sound, rpm/vehiclesSounds[model].coeff ) end end setElementData ( vehicle, "carsound:lastGear", curGear, false ) setElementData ( vehicle, "carsound:lastRPM", rpm, false ) end end end end end function playGearSound(vehicle) if isElement ( vehicle ) then local x,y,z = getElementPosition ( vehicle ) local px,py,pz = getElementPosition ( localPlayer ) if getDistanceBetweenPoints3D ( x,y,z, px,py,pz ) < 10 then local model = getElementModel ( vehicle ) local gearSound = playSound3D ( vehiclesSounds[model].gear, x, y, z, false ) setSoundVolume(gearSound, 2) attachElements ( gearSound, vehicle ) end end end Link to comment
MIKI785 Posted November 3, 2016 Share Posted November 3, 2016 You could at least mark those lines for us (n. 214 and 248). I think that the issue is that in the first code 'model' is not defined and in the second one 'gear' is not defined. They're simply nil and you are trying to index a table with them resulting in that error. Link to comment
dsmatias Posted November 3, 2016 Author Share Posted November 3, 2016 Line 214: else Line 248: local model = getElementModel ( vehicle ) The lines are in this part of the client that sent the top 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