Jump to content

Wheel replacement


velcan1

Recommended Posts

Hi all, Im here to ask for help with a wheel replacement script, Im not sure why it wont work, its suposed to be working fine...

local wheelDFFS = { 
    {"wheel_1", 1025}, 
    {"wheel_2", 1073},  
    {"wheel_3", 1074},  
    {"wheel_4", 1075},  
    {"wheel_5", 1076},  
    {"wheel_6", 1077},  
    {"wheel_7", 1078},  
    {"wheel_8", 1079},  
    {"wheel_9", 1080},  
    {"wheel_10", 1081},  
    {"wheel_11", 1082},  
    {"wheel_12", 1083}, 
    {"wheel_13", 1084}, 
    {"wheel_14", 1085}, 
    {"wheel_15", 1096}, 
    {"wheel_16", 1097}, 
    {"wheel_17", 1098}, 
} 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
for index, dff in pairs(wheelDFFS) do 
    local thedff = engineLoadDFF("wheels/".. tostring(dff[1]) ..".dff", tonumber(dff[2])) 
    engineReplaceModel(thedff, tonumber(dff[2])) 
end 
local txd = engineLoadTXD("wheels/wheels.txd") 
engineImportTXD(txd, 1025) 
end) 

If someone can help me please.

Link to comment
wheelDFFS = { 
    {"wheel_1", 1025}, 
    {"wheel_2", 1073},  
    {"wheel_3", 1074},  
    {"wheel_4", 1075},  
    {"wheel_5", 1076},  
    {"wheel_6", 1077},  
    {"wheel_7", 1078},  
    {"wheel_8", 1079},  
    {"wheel_9", 1080},  
    {"wheel_10", 1081},  
    {"wheel_11", 1082},  
    {"wheel_12", 1083}, 
    {"wheel_13", 1084}, 
    {"wheel_14", 1085}, 
    {"wheel_15", 1096}, 
    {"wheel_16", 1097}, 
    {"wheel_17", 1098}, 
} 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
for index, dff in pairs(wheelDFFS) do 
    local thedff = engineLoadDFF("wheels/".. dff[1] ..".dff", dff[2]) 
    engineReplaceModel(thedff, dff[2]) 
end 
local txd = engineLoadTXD("wheels/wheels.txd") 
engineImportTXD(txd, 1025) 
end) 

Link to comment
wheelDFFS = { 
    {"wheel_1", 1025}, 
    {"wheel_2", 1073},  
    {"wheel_3", 1074},  
    {"wheel_4", 1075},  
    {"wheel_5", 1076},  
    {"wheel_6", 1077},  
    {"wheel_7", 1078},  
    {"wheel_8", 1079},  
    {"wheel_9", 1080},  
    {"wheel_10", 1081},  
    {"wheel_11", 1082},  
    {"wheel_12", 1083}, 
    {"wheel_13", 1084}, 
    {"wheel_14", 1085}, 
    {"wheel_15", 1096}, 
    {"wheel_16", 1097}, 
    {"wheel_17", 1098}, 
} 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
for index, dff in pairs(wheelDFFS) do 
    local thedff = engineLoadDFF("wheels/".. dff[1] ..".dff", 0) 
    engineReplaceModel(thedff, dff[2]) 
end 
local txd = engineLoadTXD("wheels/wheels.txd") 
engineImportTXD(txd, 1025) 
end) 

Edited by Guest
Link to comment

This should work

wheelDFFS = { 
    {"wheel_1", 1025}, 
    {"wheel_2", 1073},  
    {"wheel_3", 1074},  
    {"wheel_4", 1075},  
    {"wheel_5", 1076},  
    {"wheel_6", 1077},  
    {"wheel_7", 1078},  
    {"wheel_8", 1079},  
    {"wheel_9", 1080},  
    {"wheel_10", 1081},  
    {"wheel_11", 1082},  
    {"wheel_12", 1083}, 
    {"wheel_13", 1084}, 
    {"wheel_14", 1085}, 
    {"wheel_15", 1096}, 
    {"wheel_16", 1097}, 
    {"wheel_17", 1098}, 
} 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
for k, i in ipairs(wheelDFFS) do 
    local thedff = engineLoadDFF("wheels/".. tostring(wheelDFFS[k][1]) ..".dff", 0) 
    engineReplaceModel(thedff, tonumber(wheelDFFS[k][2])) 
end 
local txd = engineLoadTXD("wheels/wheels.txd") 
engineImportTXD(txd, 1025) 
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...