5150 Posted August 21, 2016 Share Posted August 21, 2016 whats wrong with this? addEventHandler ( "onPlayerJoin", root, function () setPlayerHudComponentVisible ( source, "ammo", false ) setPlayerHudComponentVisible ( source, "weapon", false ) setPlayerHudComponentVisible ( source, "armor", false ) setPlayerHudComponentVisible ( source, "health", false ) setPlayerHudComponentVisible ( source, "money", false ) setPlayerHudComponentVisible ( source, "breath", false ) setPlayerHudComponentVisible ( source, "clock", false ) setPlayerHudComponentVisible ( source, "radar", false ) end ) Link to comment
StefanAlmighty Posted August 21, 2016 Share Posted August 21, 2016 Does it give any errors in debugscript and is the file included in the meta? Link to comment
IamWooky Posted August 22, 2016 Share Posted August 22, 2016 (edited) addEventHandler ( "onPlayerSpawn", root, function () setPlayerHudComponentVisible ( source, "ammo", false ) setPlayerHudComponentVisible ( source, "weapon", false ) setPlayerHudComponentVisible ( source, "armor", false ) setPlayerHudComponentVisible ( source, "health", false ) setPlayerHudComponentVisible ( source, "money", false ) setPlayerHudComponentVisible ( source, "breath", false ) setPlayerHudComponentVisible ( source, "clock", false ) setPlayerHudComponentVisible ( source, "radar", false ) end ) Problem was.. that you cannot see change.. until you reconnect.. i changed event to onPlayerSpawn.. also make sure that you put it in serverside script Edited August 22, 2016 by Guest Link to comment
Ahmed Ly Posted August 22, 2016 Share Posted August 22, 2016 addEventHandler ( "onPlayerJoin", root, function () setPlayerHudComponentVisible (source,"all",false ) end ) Link to comment
G-Stefan Posted August 22, 2016 Share Posted August 22, 2016 If you start the script when you are already joined the script wont do anything because the event is "onPlayerJoin" .This is the reason you need to reconnect to see it addEventHandler("onPlayerJoin",root, function () showPlayerHudComponent(source,"all",false) end ) addEventHandler("onResourceStart",root, function() for i,v in pairs (getElementsByType("player")) do showPlayerHudComponent(v,"all",false) end end ) Should do the job 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