Jump to content

how to create an GUI chat box?


crazyde21

Recommended Posts

guiCreateEdit  
       guiCreateButton 
  
function clickplayers ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) 
if button=="left" then 
if state =="down" then 
   if getElementType ( clickedElement ) =="player" then  
   if clickedElement != getLocalPlayer() then  --check isn't me. 
    triggerEvent ( "chatboxSend", getLocalPlayer() ) -- me chat box 
    triggerEvent ( "chatboxTO", clickedElement ) -- player chat box 
end 
end 
end 
end 
end 
addEventHandler ( "onClientClick", getRootElement(), clickplayers ) 
  
addEvent ( "chatboxTO", true ) 
function playerchatbox ( ) 
        guiCreateWindow(0.34, 0.31, 0.28, 0.30, "chatbox", true) 
        guiWindowSetSizable(window[1], false)        
end 
addEventHandler ( "chatboxTO", root, playerchatbox ) 
  
addEvent ( "chatboxSend", true ) 
function mychatbox (  ) 
        guiCreateWindow(0.34, 0.31, 0.28, 0.30, "chatbox", true) 
        guiWindowSetSizable(window[1], false)     
end 
  
addEventHandler ( "chatboxSend", root, mychatbox ) 

See and my Q: how to create an GUI chat box, and my friend talk? .text in"guiCreateEdit " , button send text!

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