Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Whats Infinite yield possible on 'ReplicatedStorage:WaitForChild?

Asked by 5 years ago

Hey, When i run this code it gives this errror: Infinite yield possible on 'ReplicatedStorage:WaitForChild("Remote")'. Does anyone know what this is?

wait(2)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remote = ReplicatedStorage:WaitForChild("Remote")

local function RemoteSmall()
    GetWood = false
    WC = plr.PlayerGui.WoodChopper
    WC.BG.Visible = true
    char.Humanoid.WalkSpeed = 0
    char.Humanoid.JumpPower = 0
    animation:Play()
    ShowProgress('SmallTree1')
    animation:Stop()
    char.Humanoid.WalkSpeed = 16
    char.Humanoid.JumpPower = 50

end


Remote.OnClientEvent:Connect(RemoteSmall)

1 answer

Log in to vote
1
Answered by 5 years ago

I am sure that it isn't an error but a warning RBLX:WaitForChild() yields the thread(the script) until it finds the Remote, it warns you because "Remote" might not ever exist and thus the code below it might never execute/run. Try creating the remote above it or add it manually in studio.

0
Hey, I cant get it to work... could you maybe explain it a bit more? Alwaysrube 22 — 5y
0
WaitForChild() takes two arguments. The first one is the instance, the second is the timeout. Basically it's just warning you that there is no timeout, so it could be waiting for the instance forever. turtle2004 167 — 5y
0
What do i need to add so it can find it? Is it a remote event? Im trying understand this page: https://developer.roblox.com/api-reference/function/RemoteEvent/FireClient Alwaysrube 22 — 5y
0
Don't worry about it, just make sure that there is a remote Formidable_Beast 197 — 5y
View all comments (5 more)
0
But is doesnt work :( Alwaysrube 22 — 5y
0
add a RemoteEvent in ReplicatedStorage and name it "Remote" the8bitdude11 358 — 5y
0
Thanks, the warning is gone! The thing still does not work... Alwaysrube 22 — 5y
0
If you need help with making it work, you should probably make another question Roardorak 20 — 5y
0
Not a good idea to make another question, as that's spam and is against the rules... Think next time. turtle2004 167 — 5y
Ad

Answer this question