You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Hi, I’m trying to figure out why there’s an error when I try to get the name of an instance. -
What is the issue? Include screenshots / videos if possible!
It prints the instance and its parent (folder named attackable) but says attempt to index nil with name when I’m trying to get its name
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Tried printing out a bunch of other things but nothing really helped
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local function setPriority(player,number,animID)
print(inQueue[player][2].Parent)
print(inQueue[player][2].Name)
local enemy
for _,v in pairs(game.Workspace:GetDescendants()) do
if string.find(v.Name,inQueue[player][2].Name) then
enemy = v.HumanoidRootPart
end
end
print(enemy)
...


--This is where I set the table up
inQueue[plr] = {Time,Enemy.Parent}
wait()
setPriority(plr,Time,Enemy) -- set priority is starting the first few lines above
--the table should look something like this
inQueue = {
[playerInstance] = {time,enemy}
}