Jump to content

Bad Argument #1 to 'gsub'


..:D&G:..

Recommended Posts

Posted

Hey, I get this error when I join the game: bad argument #! to 'gsub' (string expected, got boolean)

local mapName2 = mapName 
    for k,v in ipairs(MapTags) do 
        mapName2 = string.gsub(mapName2,v,"") --< --This line 
    end 

Posted

mapName2 isn't a string. Which means the problem lies outside of the code you posted. Whatever mapName is it's not a string, and hence mapName2 isn't either.

Posted

Can't assist you if you don't supply us with enough code to help you. As Driggero said, it's not a string. If you're trying to store the name inside "mapName", it's most likely failing and returning false. Thus, the boolean.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...