Jump to content

Recommended Posts

I would like to make a hat that will clear away the canopy overlay while the player is in the jungle. And I found the following code around line 520 in playerhud.lua:

local player = GetPlayer()	  
	    self.under_leaves = false 

	    local pos = GetPlayer():GetPosition()
	    local ground = GetWorld()
	    local tile = ground.Map:GetTileAtPoint(pos.x, 0, pos.z)
	    for i,tiletype in ipairs(IS_CANOPY_TILE)do
	    	if tiletype == tile then
	    		self.under_leaves = true

If I add

and not player:HasTag("myhattag")

to the "if" statement, it will work.

So my question is, how do I package this code change into something like modmain.lua so I don't have to update playerhud.lua every time the game is updated?

Edited by Skittish Robot

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
×
  • Create New...