proracer Posted January 7, 2011 Share Posted January 7, 2011 ---------------------------------- --SCRIPT MADE BY -[xXx]-Pr0RaC3R-- ---------------------------------- ---------------------------- --New Commands Version 1.0-- ---------------------------- ---------------------------- -- Command 1 --------------- ---------------------------- function addCommand1(commandName) local localPlayer = getPlayerName outputChatBox ( localPlayer.. "is now AFK.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("afk", addCommand1) ---------------------------- -- Command 2 --------------- ---------------------------- function addCommand2(commandName) local player123 = getPlayerName outputChatBox ( localPlayer.. " will be right back.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("brb", addCommand2) ---------------------------- -- Command 3 --------------- ---------------------------- function addCommand3(commandName) local localPlayer = getPlayerName outputChatBox ( localPlayer.. "thinks this was a good game.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("gg", addCommand3) ---------------------------- -- Command 4 --------------- ---------------------------- function addCommand4(commandName) local localPlayer = getPlayerName outputChatBox ( localPlayer.. "thinks this was a bad game.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("bg", addCommand4) ---------------------------- -- Command 5 --------------- ---------------------------- function addCommand5(commandName) local localPlayer = getPlayerName outputChatBox ( localPlayer.. "thinks that was unfair.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("unfair", addCommand5) When I type any command it gives me: "Attemp to concatenate local 'localPlayer' . I also tried to remove local variables and assign to 1 global variable like: player123 = getPlayerName But still nothing Sry people, I'm just a beginner EDIT: Sorry I just find that I didn't set any argument for "getPlayerName" but I don't know what argument to put. I put argument like: source,playerSource and still nothing.But the function is now global. NEW CODE: ---------------------------------- --SCRIPT MADE BY -[xXx]-Pr0RaC3R-- ---------------------------------- ---------------------------- --New Commands Version 1.0-- ---------------------------- player123 = getPlayerName(source) ---------------------------- -- Command 1 --------------- ---------------------------- function addCommand1(commandName) outputChatBox ( player123.. "is now AFK.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("afk", addCommand1) ---------------------------- -- Command 2 --------------- ---------------------------- function addCommand2(commandName) outputChatBox ( player123.. " will be right back.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("brb", addCommand2) ---------------------------- -- Command 3 --------------- ---------------------------- function addCommand3(commandName) outputChatBox ( player123.. "thinks this was a good game.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("gg", addCommand3) ---------------------------- -- Command 4 --------------- ---------------------------- function addCommand4(commandName) outputChatBox ( player123.. "thinks this was a bad game.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("bg", addCommand4) ---------------------------- -- Command 5 --------------- ---------------------------- function addCommand5(commandName) outputChatBox ( player123.. "thinks that was unfair.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("unfair", addCommand5) Problem is that is giving me a bad argument at line 9. Link to comment
Castillo Posted January 7, 2011 Share Posted January 7, 2011 ---------------------------------- --SCRIPT MADE BY -[xXx]-Pr0RaC3R-- ---------------------------------- ---------------------------- --New Commands Version 1.0-- ---------------------------- ---------------------------- -- Command 1 --------------- ---------------------------- function addCommand1(thePlayer,commandName) outputChatBox ( getPlayerName(thePlayer).. "is now AFK.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("afk", addCommand1) ---------------------------- -- Command 2 --------------- ---------------------------- function addCommand2(thePlayer,commandName) outputChatBox ( getPlayerName(thePlayer).. " will be right back.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("brb", addCommand2) ---------------------------- -- Command 3 --------------- ---------------------------- function addCommand3(thePlayer,commandName) outputChatBox ( getPlayerName(thePlayer).. "thinks this was a good game.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("gg", addCommand3) ---------------------------- -- Command 4 --------------- ---------------------------- function addCommand4(thePlayer,commandName) outputChatBox ( getPlayerName(thePlayer).. "thinks this was a bad game.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("bg", addCommand4) ---------------------------- -- Command 5 --------------- ---------------------------- function addCommand5(thePlayer,commandName) outputChatBox ( getPlayerName(thePlayer).. "thinks that was unfair.", getRootElement(), 255, 0, 0, true ) end addCommandHandler ("unfair", addCommand5) Link to comment
proracer Posted January 7, 2011 Author Share Posted January 7, 2011 Thanks alot.I have always problems with supplied arguments. 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