Jump to content

Help! sniper crosshair (DayZ)


Alraaayts

Recommended Posts

  • Moderators
16 minutes ago, Alraaayts said:

Bro help please

Don’t expect from me to tell you what’s wrong in the code from phone screenshots.

Here is a good tutorial how to debug your codes: 

 

Edited by Patrick
Link to comment
  • 1 month later...

Put this in to a client side lua

local alpha = 255 

bindKey ( "aim_weapon", "both", function ( _, state ) 
	if getPedWeaponSlot(localPlayer) == 6 or getPedWeaponSlot(localPlayer) == 5 then 
	
		if ( state == "down" ) then 
			alpha = 0 
		elseif ( state == "up" ) then 
			alpha = 255 
		end 
		
		if getPedWeapon(localPlayer) == 34 then
			for _, v in ipairs ( getElementsByType("object",resourceRoot,true) ) do 
				if isElementAttachedToBone ( v ) then  
					if getPedWeaponSlot (localPlayer) == 6 then 
						setElementAlpha ( v, alpha )
					end
				end
			end 
		end 
		
	end 
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...