Best-Killer Posted December 2, 2015 Share Posted December 2, 2015 Hey Guys , can anyone give me examples for make script (infos) example (script) ./infohelp , after that command showing a message in topbar : /spam /insult /caps ,, after that the play can use spam or insult or caps ..... when use /spam it's showing message mainchat to all player Infos: Stop Spamming .......... ect please help me Link to comment
Captain Cody Posted December 2, 2015 Share Posted December 2, 2015 More info of what you want maybe Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 More info of what you want maybe example (script) ./infohelp , after that command showing a message in topbar : /spam /insult /caps ,, after that the play can use spam or insult or caps ..... when use /spam it's showing message mainchat to all player Infos: Stop Spamming .......... ect Link to comment
Captain Cody Posted December 2, 2015 Share Posted December 2, 2015 For topbar - It depends on the script, or you can make gui come up from a certain amount of time. For /caps or what not For caps- function Caps () outputchatbox("Info: Please turn off your caps") end addcommandhandler("caps", Caps For spam function Spam () outputchatbox("Info: Please stop spamming chat") end addcommandhandler("spam", Spam and so on Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 For topbar - It depends on the script, or you can make gui come up from a certain amount of time.For /caps or what not For caps- function Caps () outputchatbox("Info: Please turn off your caps") end addcommandhandler("caps", Caps For spam function Spam () outputchatbox("Info: Please stop spamming chat") end addcommandhandler("spam", Spam and so on Thanks You But Bro i want players can not use the commands without using /infohelp first Link to comment
Captain Cody Posted December 2, 2015 Share Posted December 2, 2015 Create a table playerinfos = {} function infostuff () playerinfos[source] = {} local localplayerinfos = playerinfos[source] localplayerinfos["infos"] = true outputChatBox ( "/Spam /Caps ...Etc.. <--- Input chat message you want", source ) end addCommandHandler("infohelp", infostff ) function spam () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Stop spamming chat" ) end end addCommandHandler ("spam", spam) function caps () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Please turn caps lock off" ) end end addCommandHandler ("caps", caps) --- Add in the other chat messages with the format I put --- Questions? Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 Create a table playerinfos = {} function infostuff () playerinfos[source] = {} local localplayerinfos = playerinfos[source] localplayerinfos["infos"] = true outputChatBox ( "/Spam /Caps ...Etc.. <--- Input chat message you want", source ) end addCommandHandler("infohelp", infostff ) function spam () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Stop spamming chat" ) end end addCommandHandler ("spam", spam) function caps () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Please turn caps lock off" ) end end addCommandHandler ("caps", caps) --- Add in the other chat messages with the format I put --- Questions? not work ERROR: Testinginfos/client.lua:15: attempt toindex local 'localplayerinfos(a nil value) Link to comment
Captain Cody Posted December 2, 2015 Share Posted December 2, 2015 Make it server sided. Link to comment
Captain Cody Posted December 2, 2015 Share Posted December 2, 2015 If that doesn't work then either wait for someone else to respond or I'll figure out the issue in the morning. Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 bad argument @'addcommandhandler' expected function at argument 2 , got nil Link to comment
Captain Cody Posted December 2, 2015 Share Posted December 2, 2015 playerinfos = {} function infostuff () playerinfos[source] = {} local localplayerinfos = playerinfos[source] localplayerinfos["infos"] = true outputChatBox ( "/Spam /Caps ...Etc.. <--- Input chat message you want", source ) end addCommandHandler("infohelp", infostuff ) function spam () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Stop spamming chat" ) end end addCommandHandler ("spam", spam) function caps () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Please turn caps lock off" ) end end addCommandHandler ("caps", caps) --- Add in the other chat messages with the format I put --- Try that, made a typo Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 Table index nil Link to comment
Overkillz Posted December 2, 2015 Share Posted December 2, 2015 Try this local iHelp = false function infoHelp() iHelp = true outputchatbox("/spam /insult /caps ..") end addcommandhandler("infohelp", infoHelp function Caps() if infoAllow == true then outputchatbox("Info: Please turn off your caps") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("caps", Caps function Spam() if infoAllow == true then outputchatbox("Info: Please stop spamming chat") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("spam", Spam) function Insult() if infoAllow == true then outputchatbox("Info: Please don't insult BITCH !") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("insult", Insult) Not tested. Link to comment
1LoL1 Posted December 2, 2015 Share Posted December 2, 2015 Try this local iHelp = false function infoHelp() iHelp = true outputchatbox("/spam /insult /caps ..") end addcommandhandler("infohelp", infoHelp function Caps() if infoAllow == true then outputchatbox("Info: Please turn off your caps") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("caps", Caps function Spam() if infoAllow == true then outputchatbox("Info: Please stop spamming chat") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("spam", Spam) function Insult() if infoAllow == true then outputchatbox("Info: Please don't insult BITCH !") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("insult", Insult) Not tested. Your forgot 2x ")" local iHelp = false function infoHelp() iHelp = true outputchatbox("/spam /insult /caps ..") end addcommandhandler("infohelp", infoHelp) function Caps() if infoAllow == true then outputchatbox("Info: Please turn off your caps") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("caps", Caps) function Spam() if infoAllow == true then outputchatbox("Info: Please stop spamming chat") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("spam", Spam) function Insult() if infoAllow == true then outputchatbox("Info: Please don't insult BITCH !") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("insult", Insult) Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 attemt to call global addcommandhandler ' (a nill value ) Link to comment
Addlibs Posted December 2, 2015 Share Posted December 2, 2015 Change both occurrences of addcommandhandler on line 7 and 17 to addCommandHandler — Note the function is case sensitive Link to comment
Captain Cody Posted December 2, 2015 Share Posted December 2, 2015 playerInfos = {} function infostuff () playerInfos[source] = {} local localplayerinfos = playerInfos[source] localplayerinfos["infos"] = true outputChatBox ( "/Spam /Caps ...Etc.. <--- Input chat message you want", source ) end addCommandHandler("infohelp", infostuff ) function spam () local localplayerinfos = playerInfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Stop spamming chat" ) end end addCommandHandler ("spam", spam) function caps () local localplayerinfos = playerInfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Please turn caps lock off" ) end end addCommandHandler ("caps", caps) --- Add in the other chat messages with the format I put --- Fixed a few errors, try this (Server sided) Link to comment
Overkillz Posted December 2, 2015 Share Posted December 2, 2015 local iHelp = false function infoHelp() iHelp = true outputchatbox("/spam /insult /caps ..") end addCommandHandler("infohelp", infoHelp) function Caps() if infoAllow == true then outputchatbox("Info: Please turn off your caps") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addCommandHandler("caps", Caps) function Spam() if infoAllow == true then outputchatbox("Info: Please stop spamming chat") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addCommandHandler("spam", Spam) function Insult() if infoAllow == true then outputchatbox("Info: Please don't insult BITCH !") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addCommandHandler("insult", Insult) Should work ... Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 playerInfos = {} function infostuff () playerInfos[source] = {} local localplayerinfos = playerInfos[source] localplayerinfos["infos"] = true outputChatBox ( "/Spam /Caps ...Etc.. <--- Input chat message you want", source ) end addCommandHandler("infohelp", infostuff ) function spam () local localplayerinfos = playerInfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Stop spamming chat" ) end end addCommandHandler ("spam", spam) function caps () local localplayerinfos = playerInfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Please turn caps lock off" ) end end addCommandHandler ("caps", caps) --- Add in the other chat messages with the format I put --- Fixed a few errors, try this (Server sided) Not work Try this local iHelp = false function infoHelp() iHelp = true outputchatbox("/spam /insult /caps ..") end addcommandhandler("infohelp", infoHelp function Caps() if infoAllow == true then outputchatbox("Info: Please turn off your caps") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("caps", Caps function Spam() if infoAllow == true then outputchatbox("Info: Please stop spamming chat") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("spam", Spam) function Insult() if infoAllow == true then outputchatbox("Info: Please don't insult BITCH !") else outputchatbox("You are not allowed to use this | Type /infohelp") end end addcommandhandler("insult", Insult) Not tested. Worked But when i use /infohelp then /spam or /insult or anything it's showing to me : You are not allowed to use this | Type /infohelp Link to comment
Captain Cody Posted December 2, 2015 Share Posted December 2, 2015 What is the exact error you get? Link to comment
Overkillz Posted December 2, 2015 Share Posted December 2, 2015 It shouldn't show u other messages, only: " /spam /insult /caps .. " Be sure that u are copying the code correctly. Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 (edited) It shouldn't show u other messages, only: " /spam /insult /caps .. "Be sure that u are copying the code correctly. Ik Bro i used /infohelp and after infohelp i used /spam but spam showing to me : You are not allowed to use this | Type /infohelp Edited December 2, 2015 by Guest Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 What is the exact error you get? table index nill Link to comment
Best-Killer Posted December 2, 2015 Author Share Posted December 2, 2015 What line? 5 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