String.find doesnt work with name and a value?

Basically I have a script to add shields to player character, but sometimes the shields collide with capes, so I’m thinking of doing a special function for people with capes. It works good, until the point where I use string.find.
My code is:

local shieldCape = {"Shield_Cape"; "Shield_Reinforced_Cape"; "Shield_Steel_Cape"}
	if table.find(shieldCape, v.Name) then
		print('checking')
		if string.find(shield.Value, v.Name) then
			print('yes cape')
			return
		end
	end

so the “checking” prints in the output, but the “yes cape” doesnt print.

I have 3 different shields in the team folder, that are named Shield, Shield_Reinforced and Shield_Steel, so I want the script to select the same shield type, but with _Cape added in the end, so how would I script that?

omg i just got an idea that fixed the script
so instead of string.find() i did this:

if tostring(shield.Value.."_Cape") == v.Name then

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.