Got a Small Problem that i cant seem to Fix

So basically i did fixes for most of the last 5 Days

but this problem still haunts me and i dont know what the Solution could be.

Anyone can help ?

  • Screenshots of the Error + Script —>

https://gyazo.com/4137ad777ef886682c856c29578165a3 [Error]
https://gyazo.com/25f0022fd86b36cb3a5f55b33bc22a82 [Script]

Are you sure there is a fakehead with Eyes?
Also try to use :FindFirstChild("Eyes") or before you use eyes use :WaitForChild("Eyes")

1 Like

Assuming that Eyes is a part parented to FakeHead, your error is likely that the game has not yet registered all the children of FakeHead at the time it is attempting to index it. You could fix this by using :WaitForChild() for all the children you will be accessing before entering the spawned while loop.

local thing = Player.Character:WaitForChild("FakeHead")
local eyes = thing:WaitForChild("Eyes")
local socket = thing:WaitForChild("Socket")
spawn(function()
   --The rest of your code here
end)

There was a post mentioning some changes to :WaitForChild() in Updates/Announcements just a few days ago. It might be worth a read as it summarizes pretty well what you can (and more importantly cannot) assume about children after calls to :WaitForChild().

–East98

Jeah there is ill try the WaitForChild one apparently there was a update

Thanks for the quick response ill try it out right now !

This fixed it ^ but now the Iris is just disappearing and appearing sometimes inbetween but thanks for the help

any chance u know what the problem for this could be ?

https://gyazo.com/782a05b1d4894f440e9c48d4108b045f

There is no Error in the Console whatsoever.

Probably that the texture needs to be reloaded every time you reset its Texture property. Instead of toggling between different asset IDs in the Texture property of one object you could toggle between two objects which already have the Texture property set to each of the states you wish to toggle between. Then just toggle between the first being visible while the second is invisible and vice versa.