• For Loop: Why is this an error?
    3 replies, posted
Why am I getting an error? I'm so stumped, any ideas guys? [CODE] function tester(player, command, args) for a, b in pairs( player.GetAll() ) do print(v:Name(), v:SteamID(), v:IPAddress() ) end end concommand.Add("tester", tester ) [/CODE] [IMG]http://snag.gy/6FusG.jpg[/IMG]
You're getting an error because you're using v as the player when you declared it as b. Try replacing [CODE]print(v:Name(), v:SteamID(), v:IPAddress() )[/CODE] with [CODE]print(b:Name(), b:SteamID(), b:IPAddress() )[/CODE]
Because you are overriding the player variable in your function. Replace function tester(player, command, args) with function tester(ply, command, args) [editline]19th November 2013[/editline] + what PormaHD said.
True, but the error that he pointed it is not due to that at all. Change the name of your first argument in the function from something other than a library name. You are temporarily creating a local variable with the name of the library you are trying to access. Damn sneaky ninjas these days :/
Sorry, you need to Log In to post a reply to this thread.