VenomOG Posted February 17, 2018 Share Posted February 17, 2018 (edited) Hey i am new to scripting Wiki is helping me alot lets start Spoiler Edited February 17, 2018 by Venon1 Link to comment
KaMi Posted February 17, 2018 Share Posted February 17, 2018 Hello, welcome to lua. Your code is well done, the only problem is that you did not specify the "source" and anclasted the event badly to the function. Here is the solution : function msg ( source ) --Here you clarify that "source" would come as a player local joinedPlayerName = getPlayerName ( source ) local serverName = getServerName( ) -- and send him a greeting outputChatBox ( "Welcome " .. joinedPlayerName .. " to ".. serverName .."!" , source, 255, 255, 255 ) end addEventHandler ( "onPlayerJoin", getRootElement(), msg ) --Each time you anchor the event to the function, you must put the name of this Link to comment
DNL291 Posted February 17, 2018 Share Posted February 17, 2018 You copied-and-pasted and an example of MTA Wiki which is pretty simple, to make a tutorial using a code that isn't yours? Also you can't even understand that code. Proof of this is that you only changed the function name and forgot to change in the event handler too. Would be better you post in the scripting section so someone would explain you how it works. 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