Jump to content

remove Event


Fabioxps

Recommended Posts

Yo ucan export a function that removes it, then use the exported function.

how can I export from another script to remove an event?

  
function drawSidebarNote(player) 
    return exports.Side:drawSidebarNote(player) 
end 
  
  
local visible = true 
  
bindKey("F6","down", 
    function() 
        if visible then 
                        removeEventHandler("onClientRender",getRootElement(),drawSidebarNote) 
             visible = false 
                     else  
                    addEventHandler("onClientRender",getRootElement(),drawSidebarNote) 
            visible = true 
        end       
end) 

Link to comment

I don't quite understand your code so this is just example but it should help you:

1st resource with the event:

function removeMyEvent () 
removeEventHandler("eventName", element, function) --Put there the same arguments as in addEventHandler 
end 

meta of 1st resource:

function="removeMyEvent" type="server"/> 

change server/client...

2nd resource where you want to remove the event:

exports.Side:removeMyEvent() --I presume that Side is the name of your resource with the event 

If you don't understand it, post codes of both resources.

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