Hello I want a code if you select a player Is not the words you type in the box and you press the button .. puts his name will be decorated with the name, this is my attempt
-- # Client Side
addEventHandler("onClientGUIClick",root,
function ( )
if ( source == button ) then
if ( guiGridListGetSelectedItem(pList ) ~= -1 ) then
local plr = guiGridListGetItemText(pList ,guiGridListGetSelectedItem(pList ),1)
local player = getPlayerFromName ( plr )
local name = guiGetText ( Edit )
triggerServerEvent("setPlayerName", root, plr, name)
guiSetVisible(SlapWnd,false)
guiSetInputEnabled(false)
showCursor(false)
end
end
end
)
--# Server Side
xChatFunc = function (message,type,name,plr)
local r,g,b = getPlayerNametagColor(source)
if ( type == 0 ) then
cancelEvent()
outputChatBox(name ,..message,plr,r,g,b,true)
end
end
end
addEventHandler("onPlayerChat",root,xChatFunc)
addEventHandler("setPlayerName",root
addEvent("setPlayerName",true)