Jump to content

Trigger error


drowned_and

Recommended Posts

Hopefully someone can help me with this.

I get this error but I got no clue why.

"Server triggered the event onClientKey, but event is not marked as remotly Triggerable"

Clientside:

addEvent("onClientKey", true) 
addEventHandler("onClientKey", root, function(key, pressed) 
  
  
  
  if key == getKeyBoundToCommand("screenshot") and pressed then 
  
    local chatterName = getPlayerName ( getLocalPlayer() ) 
  
outputChatBox ( chatterName.." has made a screenshot.", true ) 
  
  
  
  end 
  
end) 
  

Serverside:

triggerClientEvent ( "onClientKey", getRootElement(), "playerUsesScreen" ,true ) 
  

Link to comment

-- client side:

addEventHandler("onClientKey",root, 
function (key, pressed) 
     if (key == getKeyBoundToCommand("screenshot") and pressed) then 
           triggerServerEvent("onPlayerTookScreenshot",localPlayer) 
     end 
end) 

-- server side:

addEvent("onPlayerTookScreenshot",true) 
addEventHandler("onPlayerTookScreenshot",root, 
function () 
    local chatterName = getPlayerName ( source ) 
    outputChatBox ( chatterName.." has made a screenshot.", true ) 
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...