Jump to content

triggerClientEvent


FuriouZ

Recommended Posts

Hey

I have problem with triggerClientEvent

so, if i press button, then debug line 74 says attempt to call global 'trigerClientEvent' (a nil value)

settings: (client)

GUIEditor = {} 
  
function drawSettingsWind() 
        GUIEditor.window = guiCreateStaticImage(0.08, 0.04, 0.72, 0.94, "img/window.png", true) 
        GUIEditor.closeButton = guiCreateStaticImage(0.94, 0.00, 0.06, 0.09, "img/close.png", true, GUIEditor.window)   
        guiSetVisible(GUIEditor.window, true)    
        guiSetEnabled(GUIEditor.window, true)        
end 
--[[ 
function showSettingsWind () 
        guiSetVisible(GUIEditor.window, true)    
        guiSetEnabled(GUIEditor.window, true)    
end]] 
addEvent("showSettings", true)  
addEventHandler("showSettings", getRootElement(), drawSettingsWind) 
  

panel: (client)

addEventHandler("onClientGUIClick", root, 
function() 
if source == GUIEditor.settingsButton then 
    triggerClientEvent ( "showSettings", getLocalPlayer() ) --Line 74 
end 
end 
)    

Merry Christmas and thanks :)

IIYAMA, stay away from this topic.Thanks.

Link to comment

if the script1 file it's in same folder with the script2 file then instead of use tiggerEvent you can use function name ( elements )

example:

function blabla( player ) 
  if isElement( player ) then 
     return true 
  else 
     return false 
   end 
end 
  
function blabla2 () 
      -- insteat of use triggerEvent [ This is just one example you can use it and for more things ] 
      if ( blabla( localPlayer ) == true ) then 
         blabla 
      else 
         blabla 
      end 
end 

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