Andrew75t Posted August 7, 2020 Share Posted August 7, 2020 Hello. I want to replace the default texture of the sniper rifle scope with a custom texture . how can this be done on the my server? Link to comment
Moderators Patrick Posted August 7, 2020 Moderators Share Posted August 7, 2020 Hi! You can replace the texture with engineApplyShaderToWorldTexture. -- CLIENT SIDE local raw_shader = [[ texture TEXTURE; technique TexReplace { pass P0 { Texture[0] = TEXTURE; } } ]] addEventHandler("onClientResourceStart", root, function() local shader = dxCreateShader(raw_shader) local texture = dxCreateTexture("crosshair.png") dxSetShaderValue(shader, "TEXTURE", texture) engineApplyShaderToWorldTexture(shader, "snipercrosshair") end) Crosshair image (crosshair.png): https://i.imgur.com/BzfPcsO.png 1 Link to comment
Andrew75t Posted August 8, 2020 Author Share Posted August 8, 2020 I tried to change the texture of the sight in a graphical editor and replace it through txdWorkShop, but it did not change, as well as the weapon icon, what is it connected with? I'll try your script, thanks for your answer. Link to comment
Andrew75t Posted August 8, 2020 Author Share Posted August 8, 2020 Patrick. I used your script. I have a white square instead of a sight. What is it connected with and how to fix it? Link to comment
Andrew75t Posted August 8, 2020 Author Share Posted August 8, 2020 Patrick, Thank you so much. It works for me. You helped me a lot! Link to comment
Moderators Patrick Posted August 8, 2020 Moderators Share Posted August 8, 2020 6 minutes ago, Andrew75t said: Patrick, Thank you so much. It works for me. You helped me a lot! Welcome, here is the resource btw, if anyone needs it: snipercrosshair.zip 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