Dice Posted June 20, 2013 Share Posted June 20, 2013 function triggerSwarm( myName ) runningStreaks[player] = getPlayerFromName ( myName ) runningStreaks[player].x, runningStreaks[player].y, runningStreaks[player].z = getElementPosition ( runningStreaks[player] ) end I tested myName with outputChatBox and it passes from client to server successfully. Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 So,, what is the problem??? Link to comment
xXMADEXx Posted June 20, 2013 Share Posted June 20, 2013 Try this: function triggerSwarm( myName ) runningStreaks[myName] = getPlayerFromName ( myName ) runningStreaks[myName].x, runningStreaks[myName].y, runningStreaks[myName].z = getElementPosition ( runningStreaks[myName] ) end Link to comment
ixjf Posted June 20, 2013 Share Posted June 20, 2013 (edited) The error message is very obvious I guess. getPlayerFromName never ever returns a table but still you're using the return value as if it was one. In this case, getPlayerFromName shouldn't be finding a player with the specified name and so returning false. Edited June 20, 2013 by Guest Link to comment
xXMADEXx Posted June 20, 2013 Share Posted June 20, 2013 How are you triggering "triggerSwarm" ? Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 may i see the "debugscript 3" ??? Link to comment
Moderators IIYAMA Posted June 20, 2013 Moderators Share Posted June 20, 2013 function triggerSwarm( player ) if not runningStreaks[player] then runningStreaks[player] = {} -- make it a table end runningStreaks[player]["name"] = getPlayerFromName (player ) -- insert name runningStreaks[player].x, runningStreaks[player].y, runningStreaks[player].z = getElementPosition ( runningStreaks[player] ) -- insert pos end Link to comment
uhm Posted June 20, 2013 Share Posted June 20, 2013 also i dunno if im talking bs right now but do you ever do runningStreaks = {} in other words construct the runningStreaks table also y are u using both object notation and table notation ? is that allowed? idk legit question runningStreaks[player]["name"] = getPlayerFromName (player ) runningStreaks[player].x ------> runningStreaks[player]["name"] = getPlayerFromName (player ) runningStreaks[player]["x"] ----- ? Link to comment
Moderators IIYAMA Posted June 20, 2013 Moderators Share Posted June 20, 2013 also i dunno if im talking bs right now but do you ever do runningStreaks = {} He must have because else it would start giving an error instead of a warning. ERROR: attempt to index a nil value. (title: Re: table index is nil) As far I know it is the same. runningStreaks[player].x runningStreaks[player]["x"] But I prefer ["x"]. When I use table.x, I always get confused that x is a not defined value. 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