Infinite Yield Possible on ("ServerControl")

I was Making this tool and Script Analysis was giving me 0 Error and when I tried testing it out I got error Infinite Yield Possible on Players.Player.BackPack.Tool:WaitForChild(“ServerControl”)

BaseBat.Torso.Anchored = true
BaseBat.Parent = game:GetService("Workspace")
ScaleModule.ScaleCharacter(BaseBat, 0.2, {ResizeModels = true})
BaseBat.Parent = nil

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

BaseUrl = "http://www.roblox.com/asset/?id="

Functions = require(script:WaitForChild("Functions"))
BatManagement = script:WaitForChild("BatManagement")

EffectFire = script:WaitForChild("EffectFire")
ParticleScript = script:WaitForChild("ParticleScript")

Grips = {
	Unequipped = CFrame.new(0, -0.25, 0.6, 1, 0, 0, 0, 1, 0, 0, 0, 1),
	Equipped = CFrame.new(0, -0.25, 0.6, 1, 0, 0, 0, 1, 0, 0, 0, 1),
}

Animations = {
	Equip = {Animation = Tool:WaitForChild("Equip"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
	Strike = {Animation = Tool:WaitForChild("Strike"), FadeTime = nil, Weight = nil, Speed = 1.75, Duration = 1.25},
	Slash = {Animation = Tool:WaitForChild("Slash"), FadeTime = nil, Weight = nil, Speed = 2, Duration = 1.25},
	DoubleSlash = {Animation = Tool:WaitForChild("DoubleSlash"), FadeTime = nil, Weight = nil, Speed = 1.25, Duration = 1.5},
	JumpAttack = {Animation = Tool:WaitForChild("JumpAttack"), FadeTime = nil, Weight = nil, Speed = nil, Duration = 1.125},
	Slice = {Animation = Tool:WaitForChild("Slice"), FadeTime = nil, Weight = nil, Speed = 2, Duration = 0.75},
	Cut = {Animation = Tool:WaitForChild("Cut"), FadeTime = nil, Weight = nil, Speed = 2, Duration = 1},
	SpinSlash = {Animation = Tool:WaitForChild("SpinSlash"), FadeTime = nil, Weight = nil, Speed = 2.25, Duration = 0.75},
}

Sounds = {
	Unsheath = Handle:WaitForChild("Unsheath"),
	Swipe1 = Handle:WaitForChild("Swipe1"),
	Swipe2 = Handle:WaitForChild("Swipe2"),
	Swipe3 = Handle:WaitForChild("Swipe3"),
	Swipe4 = Handle:WaitForChild("Swipe4"),
	Hit = Handle:WaitForChild("Hit"),
}

Damages = {
	Touch = 4,
	Slash = 20,
}
CurrentDamage = Damages.Touch

BasePart = Create("Part"){
	Material = Enum.Material.Plastic,
	FormFactor = Enum.FormFactor.Custom,
	TopSurface = Enum.SurfaceType.Smooth,
	BottomSurface = Enum.SurfaceType.Smooth,
	Size = Vector3.new(0.2, 0.2, 0.2),
	Anchored = false,
	CanCollide = true,
	Locked = true,
}

Gravity = 196.20

Falling = false
JumpEnabled = true
ToolEquipped = false

Tool.Enabled = true
Tool.Grip = Grips.Unequipped

ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
	Name = "ServerControl",
	Parent = Tool,
})
1 Like

Where is this script located, what type of script is it and what is “BackPack”. Do you mean StarterPack?

Well, did you read the error?

It says “infinite yield possible” because it was waiting a while for ServerControl to exist. If the script works, though, there’s nothing to worry about.

1 Like

This is likely erroring the code. Load Library was deleted a few years ago and does not function anymore. Since the code is error, the line where you create the event doesnt run and causes the Infinite Yield error in your other script.
View this post to find the replacement for Load Library LoadLibrary is going to be removed on February 3rd
Or, you can replace RbxUtility.Create with Instance.new and update each case it is used accordingly.

There is no error, this usually happens when you are using waitforchild, I usually ignore it, but it is much more efficient to use findfirstchild.