I need some help on this, the script always says:
10:34:04.532 - Infinite yield possible on 'ReplicatedStorage:WaitForChild("PlaceEvent")' 10:34:04.534 - Stack Begin 10:34:04.535 - Script 'Players.TinyScripter.Backpack.Grass.Main', Line 7 10:34:04.536 - Stack End
Does anybody know how to fix it? Here is the script I am using:
-- Local Script local tool = script.Parent local player = game.Players.LocalPlayer local mouse = player:GetMouse() local clickEvent = tool.ClickEvent local ReplicatedStorage = game:GetService("ReplicatedStorage") local PlaceEvent = ReplicatedStorage:WaitForChild("PlaceEvent") local function onActivate() local clickLocation = mouse.hit clickEvent:FireServer(clickLocation) PlaceEvent:FireServer() end tool.Activated:connect(onActivate)
Make sure you have the PlaceEvent
in ReplicatedStorage
and that the name is correct. By using WaitForChild()
, you are putting the code on hold until it is able to find the object in that directory. That gives you the Infinite yield possible
error, which means the code will yield (wait) forever until the object is found.