What do you want to achieve?
Fix the error in the script What is the issue?
It say Infinite yield possible on ‘Players.playerName.Backpack.OverseerAxe.SwordScript.EyeSpawner:WaitForChild(“cframe”)’ - Studio What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried to find something that could help me on Dev Forum but I couldn’t see anything that can help me
SwordScript
local cframeValue = script:WaitForChild("cframe")
This is the script "EyeSpawner", Parent is SwordScript
--function SpawnEye(humanoid)
if not humanoid.Torso then return end
local target = humanoid.Torso.CFrame.p
local cframe = (sp:FindFirstChild("cframe") or Instance.new("CFrameValue"))
--local cframe = Instance.new('CFrameValue')
cframe.Value = CFrame.new(target+Vector3.new(2+(5*math.random()),3,2+(5*math.random())),target)
cframe.Name ='cframe'
cframe.Parent = EyeSpawner
EyeSpawner.Disabled = true
EyeSpawner.Disabled = false
end
There’s no object named cframe inside the EyeSpawner script, it’s either that or you’re calling an unnecessary WaitForChild() infinitely yielding until there is a cframe object
I think you’re parenting the value to the wrong script. You wrote:
cframe.Parent = EyeSpawner
While WaitForChild is waiting for an addition under itself, SwordScript.
Try changing it to:
cframe.Parent = SwordScript?
In your code you have been referencing cframe as if it was an object, but Im assuming you just wanted to get the cframe and offset it by a random amount?
In that case just try