Zekrom= Posted October 2, 2011 Share Posted October 2, 2011 I am a new in the scripter's world, Im doing a commands script for race, i make a command called /ltd, ''Learn to drive'', but i want to write /ltd (a player name) and in the chat see ''Zekrom Says Learn to drive ( player name)!'' addCommandHandler("ltd", function (thePlayer) outputChatBox(getPlayerName(thePlayer).." #0099ffSays #ffffffLearn To #0099ffDrive!!",getRootElement(), 255, 255, 255, true ) end) Help please Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 try this (not tested) addCommandHandler("ltd", function (thePlayer, cmd, tarPlayer) outputChatBox(getPlayerName(thePlayer).." #0099ffSays #ffffffLearn To #0099ffDrive "..tarPlayer.." !!",root, 255, 255, 255, true ) end) Link to comment
Zekrom= Posted October 2, 2011 Author Share Posted October 2, 2011 (edited) Yeah!, it work ! Thank you !! I found something, if i write /ltd (any word) in the chat says : Zekrom Says learn to Drive (the word)!, Is there any way to do that just to put the names of the players?, And if the player is not there say in the chat: Player not found? Again, Thank You ! Edited October 2, 2011 by Guest Link to comment
TAPL Posted October 2, 2011 Share Posted October 2, 2011 addCommandHandler("ltd", function (thePlayer, cmd, tarPlayer) local name = getPlayerFromName ( tarPlayer ) if name then outputChatBox(getPlayerName(thePlayer).." #0099ffSays #ffffffLearn To #0099ffDrive "..getPlayerName(name).." !!",root, 255, 255, 255, true ) else outputChatBox("Player not found",thePlayer, 255, 255, 255, true ) end end) Link to comment
Zekrom= Posted October 2, 2011 Author Share Posted October 2, 2011 Thank You !!!!!!!!! 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