Hey guys! I’ve been working on a script that disables HUD until the player spawns. (Using ESX kashacters multiple character support)
It’s working great everywhere I have lua. However I have some status bars for health that are using javascript. I tried disabling them from the lua side and that didnt work.
So my question is, can i trigger a function is java from a lua script? Could someone give me a quick example? Thanks guys I hope I can help someone else out one of these days.
Thanks so much for this! I will check it out after work. I think I will be able to fix what I’ve been struggling with.
Hey one more question for you.
If I name a function the same thing can I trigger all 3 (assuming I have 3 named the same thing) at once?
Example:
My disable HUD before playerspawn event. Can I put functions in each script that has HUD called “DisableHUD” and then just use one trigger to call them? Currently I have 3 seperately named functions and it works great but I was just wondering.
Well here’s the NUI code I’m dealing with. I’ve tried adapting it a few different ways and the only result I get is disabling the status bars completely. Is there a way that you see to easily disable it? What’s funny is it already has a disable variable on the lua side. The problem is that it’s broken. How it works is that it checks if the pause menu is open, and if it is it passes a show = false. But the issue is it just flashes rapidly when the pause menu is up.
So long story short I could use that, but then it would just flash rapidly like it already does… LOL I wish I knew more about this. Especially because I’d like to start making new menus using NUI and forms…
Anyways if you could give me your two cents I’d appreciate it!
window.addEventListener('message', function(event) {
var data = event.data;
$(".container").css("display",data.show? "none":"block");
$("#boxHeal").css("width",data.health + "%");
$("#boxStamina").css("width",data.stamina + "%");
if (event.data.action == "updateStatus") {
updateStatus(event.data.st);
}
})
})