Skadoosh Posted February 24, 2020 Share Posted February 24, 2020 Okay so here is my problem. I am making a script which will make a text appear on the clients screen while he is attacking a rival clan base and i want that text to appear only while that player is shooting. I have tried a lot of ways and nothing seems perfect, like i was able to make the text appear only while he is shooting but it keeps blinking and thats not how i want it to be seen...i am a beginner so please reply to this asap if you have a solution to this. Link to comment
#\_oskar_/# Posted February 24, 2020 Share Posted February 24, 2020 local function OpenDx(...) local v = {...} if v[2] == true then removeEventHandler("onClientRender", root,v[1]) addEventHandler("onClientRender", root,v[1]) elseif v[2] == false then removeEventHandler("onClientRender", root,v[1]) end end function dx1() --- dxDraw(...) end OpenDx(dx1,true) -- show dx1 OpenDx(dx1,false) -- hide dx1 --/// function dx2() --- dxDraw(...) end OpenDx(dx2,true) -- show dx2 OpenDx(dx2,false) -- hide dx2 Link to comment
ReZurrecti0n Posted February 24, 2020 Share Posted February 24, 2020 What about detecting when the fire key(s) are being pressed and released? Display the text when the fire key is down and then stop displaying when the fire key has been released? However, this may get complex because of the amount of ways to attack and may just need to check a whole mess of conditions... Link to comment
The_GTA Posted February 24, 2020 Share Posted February 24, 2020 Let me throw in an idea. To avoid any kind of flickering (rapid presses of the fire button, players shooting single shots, etc) you should implement a "heated area" timer. If there was shooting at for example Groove street, then your script should remember that for 5 seconds and update the timer when new shooting happens. This way your alert GUI will stay visible. Good luck with your idea! 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