That’s odd, I think something is wrong with the function or the code that executes it. but most likely the code that executes it. Maybe in the loop, add
for i, v in ipairs(lvl) do
if v.TypeVal.Value == player.gloveLVL.Value then
CloneFunction(v,char)
print(char.Name)
print(i,v)
end
end
And in the function, at the start before local rHand, add
When I tried the test again it noticed player 2 but not player 1 this time. I also get an error saying, “ServerScriptService.main_Glove:6: attempt to index nil with ‘Name’” which I think has to do with the code ignoring the player. I am just not sure what nil is supposed to be.
nil is basically Luau terms for non existing, it didn’t recognize char so it returned nil. Try this for the PlayerAdded
plr.PlayerAdded:Connect(function(player)
print("Name of Player is "..player.Name)
player.CharacterAppearanceLoaded:Connect(function(char)
for i, v in pairs(lvl) do
if v.TypeVal.Value == player.gloveLVL.Value then
print(char.Name)
print(i,v)
CloneFunction(v,char)
end
end
char.Humanoid.Died:Connect(function()
wait(3)
player:LoadCharacter()
end)
end)
end)
player.CharacterAppearanceLoaded:Connect(function(char)
print("Character belonging to " .. char.Name " has loaded") --This
for i, v in pairs(lvl) do
if v.TypeVal.Value == player.gloveLVL.Value then
print(i,v)
CloneFunction(v,char)
end
end
char.Humanoid.Died:Connect(function()
wait(3)
player:LoadCharacter()
end)
end)
If it recognized both players but not the characters then something is going wrong somewhere, jsut not sure where
Im not sure if you can do a player.CharacterAppearanceLoaded:Wait() inside of the CharacterAdded event since it may infinitely yield, but you can try it
Or alternatively just do a 1 second wait which should only really be a last resort