xMoDy Posted June 29, 2022 Share Posted June 29, 2022 addEventHandler ( "onClientResourceStart", resourceRoot, function () txd = engineLoadTXD ( "maverick.txd" ); engineImportTXD ( txd, 487 ); dff = engineLoadDFF ( "maverick.dff" ); engineReplaceModel ( dff, 487 ); end ); local shader = [[ texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } ]] local shader, t = dxCreateShader(shader, 0, 0, true, 'world,object,vehicle') local texture = dxCreateTexture("1.png") function applyShader(thePlayer, seat) local theVehicle = source if seat == 0 and thePlayer == localPlayer and shader then if texture then dxSetShaderValue(shader, 'Tex0', texture) engineApplyShaderToWorldTexture(shader, "frogger2_sign_1", source) end end end addEventHandler("onClientVehicleEnter", getRootElement(), applyShader) ----------------------- what should i do ? here isn't works! before: after: Link to comment
AngelAlpha Posted June 29, 2022 Share Posted June 29, 2022 6 hours ago, xMoDy said: addEventHandler ( "onClientResourceStart", resourceRoot, function () txd = engineLoadTXD ( "maverick.txd" ); engineImportTXD ( txd, 487 ); dff = engineLoadDFF ( "maverick.dff" ); engineReplaceModel ( dff, 487 ); end ); local shader = [[ texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } ]] local shader, t = dxCreateShader(shader, 0, 0, true, 'world,object,vehicle') local texture = dxCreateTexture("1.png") function applyShader(thePlayer, seat) local theVehicle = source if seat == 0 and thePlayer == localPlayer and shader then if texture then dxSetShaderValue(shader, 'Tex0', texture) engineApplyShaderToWorldTexture(shader, "frogger2_sign_1", source) end end end addEventHandler("onClientVehicleEnter", getRootElement(), applyShader) ----------------------- what should i do ? here isn't works! before: after: --change dxSetShaderValue(shader, 'Tex0', texture) --to dxSetShaderValue(shader, 'gTexture', texture) because you use gTexture in shader, but not Tex0 1 Link to comment
Vampire Posted June 29, 2022 Share Posted June 29, 2022 Hello! Moving this to the Scripting section so you can get better assistance. 1 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