Jump to content

How to disable the hud for money, health weapons


vXHazE

Recommended Posts

Posted

Hi, I want to mod in a different hud and every time i mod one in the original one and the moded one overlap can anyone help me btw i dont know a lot about scripting. :D :D

Posted
-- #ServerSide 
  
addEventHandler ( "onPlayerJoin", root,  
    function (     ) 
        setPlayerHudComponentVisible ( source, "all", false )   
    end 
) 

It's very simple to hide it just use the event when the player join and the function to hide all the hud as it's in the Wiki.

Posted

i put this on the server.lau

addEventHandler ( "onPlayerJoin", root,

function ( )

setPlayerHudComponentVisible ( source, "all", false )

end

)

on meta i put

and on client i put

local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted" }

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),

function ()

for _, component in ipairs( components ) do

setPlayerHudComponentVisible( component, false )

end

end)

and it doesn't work :(

Posted

You definitely did something wrong!

Also you don't need the client version, this one should be enough:

Server.lua

addEventHandler("onPlayerJoin", getRootElement(), function() 
    setPlayerHudComponentVisible(source, "all", false); 
end);  

meta.xml

<meta> 
    <info author="POWA" version="1.0" type="script"/> 
    <script src="server.lua" type="server"/> 
</meta> 

Posted

Check Your Files and The Meta

addEventHandler ( "onPlayerJoin", root, function (      ) 
        setPlayerHudComponentVisible ( source, "all", false ); 
    end; 
); 

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...