Issue with a roleplay gamemode script.

Alright, lucky me, I finally learn LUA, and I can’t fix my problem :slight_smile:
Here’s the deal:

This is in the player_util.lua file.
The error message reads: ERROR: GAMEMODE:‘PlayerSpawn’ Failed: LemonadeScript\gamemode\player_util.lua:145: bad argument #1 to ‘pairs’ (table expected, got string)

Here’s what the line looks like, and you’ll probably see why I can’t fix it:

local meta = FindMetaTable( "Player" );

function meta:HasFlag(flag)

	local flags = LEMON.GetCharField(self, "flags" );
 for k,v in pairs(flags) do
    if(table.HasValue(flags, flag)) then return true; end
    return false;


If any more information or pieces of the code are needed, post here, or PM me, whatever is easier for you.

I’m working on this game mode to for my RP server, obviously it’s lemonadescript.

Thanks to everyone and anyone who reads this, or takes the time to help me out.


Right, so I learned that this code is written so poorly it shouldn’t be bothered with. Sorry if I wasted anyone’s time with this topic. It can be locked or deleted or whatever if a moderator or admin feels the need.

LEMON.GetCharField(self,“flags”) returns a string, not a table. That’s a problem with Lemonade script.

Yeah, and from the people I’ve spoken with today, Lemonade Script is a cheap rip of CakeScript that Looter managed to really fuck up, so I’m just gonna stick with cakescript if the stupid derma ever decides to cooperate.

don’t have malawars tools on the server or client.


for the derma not to fuck up

YOU ARE A GOD DERAJ! Thanks a million times for that. If you wan admin on my server, lemmeh kno :smiley:
I’ll be up in a bit, and it’s a custom gamemode, so it’ll be fun for you to see.