Ok so iv been trying for hours this is all i could do D: please help!
function unminion(part) if part.Parent == p.Character then return end if part.Parent:FindFirstChild("Humanoid") ~= nil then v = part.Parent.Name for i,x in pairs(minions) do if (string.upper(v) == string.upper(x)) then table.remove(x,v) end end end end
If you're going to remove something from minions
, you would expect to see minions
somewhere in the table.remove
line.
Based on looking up what table.remove
wants, it would be
table.remove(minions, i) -- as opposed to `v`
Tab your code correctly. Other cleanliness things might include using
if v:upper() == x:upper() then
instead of
if (string.upper(v) == string.upper(x)) then
Also remember to always use local
variables; v
isn't called local.