Captain Cody Posted November 25, 2015 Share Posted November 25, 2015 taxidriver = getPlayersInTeam ( TaxiDriverTeam ) outputChatBox ( "(source) needs a taxi", taxidriver ) Debug - Expected element, got table How would I do this, cannot find any thing on wiki to do this. And how would I define the person who did the command, using source gives me debug expected element got nil. addCommandHandler ("taxi", taxiMessage) function taxiMessage () Link to comment
DRW Posted November 25, 2015 Share Posted November 25, 2015 (edited) addCommandHandler ("taxi",function(player) -- player is the source of the server-executed command outputChatBox ( "This is only seen by you", player ) taxidriver = getPlayersInTeam ( TaxiDriverTeam ) for i,drivers in ipairs (taxidriver) do --This gets all the players in the team outputChatBox ( "(source) needs a taxi", drivers) --This outputs to every player in the team end end) I've fused both funcions in the same command. EDIT: Edited the code, it was wrong Edited November 25, 2015 by Guest Link to comment
Saml1er Posted November 25, 2015 Share Posted November 25, 2015 Two methods. 1. local team = createTeam (...) outputChatBox ( "(source) needs a taxi", team ) 2. for _, v in pairs ( getPlayersInTeam ( team ) ) do outputChatBox ( "(source) needs a taxi", v ) end 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