tiesjan Posted September 9, 2011 Share Posted September 9, 2011 how to make a script, if i type /welcome that all player get this messagge "welcome [theplayersname] i don't know how to do that getplayername thing please help me Link to comment
bandi94 Posted September 9, 2011 Share Posted September 9, 2011 (edited) function welcome() for i,player in pairs(getElementsByType("player")) do local name = getPlayerName(player) outputChatBox("Welcome"..name,player) end end addCommandHandler("welcome",welcome) next time try to use wiki and make a par of code Edited September 9, 2011 by Guest Link to comment
JR10 Posted September 9, 2011 Share Posted September 9, 2011 The wiki has all the functions, that exists. With it's arguments, mostly examples. So what is "i don't know how to do that getplayername thing " Ehm, getPlayerName(player) Is it so hard? You won't get nowhere, by Copy+Paste. Can you try doing this yourself? functions you will need: addEventHandler ( "welcome" , function ( player , cmd , playerName ) local target = getPlayerFromName ( playerName ) outputChatBox ( getPlayerName ( target ) ) 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