Wei Posted May 5, 2012 Share Posted May 5, 2012 g_Root = getRootElement() addEventHandler('onPlayerJoin', g_Root, function() outputChatBox("* #FF4000'" .. getPlayerName(source) .. "'#00FF00 has joined the game", 0, 255, 0, true) end ) Link to comment
Xeforine Posted May 5, 2012 Share Posted May 5, 2012 i used this in my [DM] map and it worked. function startclient() outputChatBox ("#7CFC00[Map]#AAAAAA You're now playing: [DM] #7CFC00Xeno#AAAAAA II - Bounce" , 255, 0, 0, true) outputChatBox ("#7CFC00[Map]#AAAAAA Music: Calvin Harris ft. Kelis - #7CFC00Bounce" , 255, 0, 0, true) outputChatBox ("#7CFC00[Map]#AAAAAA Press #7CFC00'M'#AAAAAA to toggle music on/off" , 255, 0, 0, true) outputChatBox ("#7CFC00[Map]#AAAAAA Goodluck and have #7CFC00Fun!" , 255, 0, 0, true) end addEventHandler("onClientResourceStart", getRootElement(), startclient) Link to comment
Wei Posted May 5, 2012 Author Share Posted May 5, 2012 Somebudy helped me allready... I needed to add root at ..., root, 255... Link to comment
Stanley Sathler Posted May 5, 2012 Share Posted May 5, 2012 I ain't good in Lua, but try it: -- Show message only to the player who called g_Root = getRootElement() addEventHandler('onPlayerJoin', g_Root, function() outputChatBox("* #FF4000'" .. getPlayerName(source) .. "'#00FF00 has joined the game", source, 0, 255, 0, true) end ) Or try it: -- Show message to all the players online g_Root = getRootElement() addEventHandler('onPlayerJoin', g_Root, function() outputChatBox("* #FF4000'" .. getPlayerName(source) .. "'#00FF00 has joined the game", root, 0, 255, 0, true) end ) Link to comment
Reflex# Posted May 5, 2012 Share Posted May 5, 2012 g_Root = getRootElement() addEventHandler('onPlayerJoin',g_Root, function () outputChatBox('#ffffff ' .. getPlayerName(source) .. '#ffffff has joined the game!', getRootElement(), 255, 255, 255, true) end ) Link to comment
Reflex# Posted May 5, 2012 Share Posted May 5, 2012 I ain't good in Lua, but try it: -- Show message only to the player who called g_Root = getRootElement() addEventHandler('onPlayerJoin', g_Root, function() outputChatBox("* #FF4000'" .. getPlayerName(source) .. "'#00FF00 has joined the game", source, 0, 255, 0, true) end ) Or try it: -- Show message to all the players online g_Root = getRootElement() addEventHandler('onPlayerJoin', g_Root, function() outputChatBox("* #FF4000'" .. getPlayerName(source) .. "'#00FF00 has joined the game", root, 0, 255, 0, true) end ) In 2 code i dont add root in the end and all work..but try this 2 scripts blazy Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now