I am trying to do, if the player's character has 2 or more objects named "SpikeHair" then it does certain code.
--More code up here
if Player.Character.SpikeHair == #2 then
--Code here
end
I am trying to do, if the player's character has 2 or more objects named "SpikeHair" then it does certain code.
--More code up here
if Player.Character.SpikeHair == #2 then
--Code here
end
local num = 0 -- makes a global variable
for i,v in pairs(Player.Character:GetChildren()) do -- iterates thruout character
if v.Name = "SpikeHair" then -- makes a condition if the name is SpikeHari
num = num+1 -- counts it
end
end
if num >= 2 then -- if the hair is more than 2
--code here
end
This discussion is preserved as it was. New answers, comments, and votes are closed.