so I have a bunch of recolors of a “present” item in my game so I use string.match to see if the items name contains the word “present” and if so it runs the line of code. But I’m confused about this error. How does name or ‘present’ return nil? Also the item doesn’t contain a “name” value.
code:
elseif string.match(wep.Name,'present') then
local available = {'daggerB','daggerY','daggerR','daggerG','whip','rope','leather','rock','stick'}
LoadWeapon(available[math.random(1,#available)], slot)
givestat(coins,250)