Jump to content

[Question]How to show Dx only while Shooting?


Skadoosh

Recommended Posts

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

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

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