I made this script and I’m getting Infinite Yield possible and I don’t understand why, the location of the object is correctly.
Console warning
Where the Script is located “Races”
My code
local char = script.Parent
local player = game.Players:GetPlayerFromCharacter(char)
local PlayerData = player:WaitForChild('PlayerData').PlayerStats
local RaceValue = PlayerData.Race
local HornsVisible = player:WaitForChild("Clothes3D").Horns
if RaceValue.Value == "Human" or RaceValue.Value == "Slayer" then
HornsVisible.InLips.Transparency = 1
HornsVisible.InLips2.Transparency = 1
elseif RaceValue.Value == "Demon" or RaceValue.Value == "Hybrid" then
HornsVisible.InLips.Transparency = 0
HornsVisible.InLips2.Transparency = 0
end
This means that “Clothes3D” couldn’t be found in the player in a certain timeframe and so it throws an Infinite Yield error telling you that, that line of code is gonna stop (yield) the rest of your code
Also, why don’t you use game.Players.LocalPlayer? You don’t have to, I just kinda noticed that