Jump to content

i need help please


likemike12

Recommended Posts

Posted

hey there

i hope this time to get some help

i need a help

how can i connect a command in a key in the keyboard

to make a bindkey for all the players not just for me

i need the code i have to use

i'm a new programer

not a new new

just new

i know about alot of things and idk alot of things

and thanks

Posted

function fanFunction()

bindKey (source,"x","down",

function(player,key,state)

outputChatBox (getPlayerName (player) .. "test",getRootElement(),255,255,0,true)

end

)

end

addEventHandler ("onPlayerLogin",getRootElement(),fanFunction)

not working with me

Posted (edited)
---Server 
  
 function fanFunction() 
 for _,v in ipairs ( getElementsByType ( "player" ) ) do 
triggerClientEvent(v,"open",v) 
end 
end 
bindKey("x", "down", fanFunction) 
  
--Client 
  
function openn() 
guiSetVisible(wnd,true) 
showCursor(true) 
end 
addEvent("open",true) 
addEventHandler("open",root,openn) 

Edited by Guest
Posted
---Server 
  
function fanFunction() 
triggerClientEvent(source,"open",source) 
end 
bindKey("x", "down", fanFunction) 
  
--Client 
  
function openn() 
guiSetVisible(wnd,true) 
showCursor(true) 
end 
addEvent("open",true) 
addEventHandler("open",root,openn) 

man not for a gui window

for command it's just server not need client

Posted
---Server 
  
function fanFunction() 
triggerClientEvent(source,"open",source) 
end 
bindKey("x", "down", fanFunction) 
  
--Client 
  
function openn() 
guiSetVisible(wnd,true) 
showCursor(true) 
end 
addEvent("open",true) 
addEventHandler("open",root,openn) 

Wouldn't even work?

bindKey 1st argument requires player at server side.

2nd. He doesn't want to create GUI as far as I see.

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