My game was pretty laggy, and I knew why. It was due to the npcs' follow scripts scanning every part of the workspace. I decided to put all non-npc models and parts in a folder in the workspace called "World". I changed some toolgiver scripts to detect the toolgivers in the folder instead of the workspace itself, however the scripts do not seem to detect anything inside the toolgivers, specifically the "Head". I even put a workspace.World.Toolgiver:WaitForChild("Head")... statement but that didn't work either. It sees everything in the toolgiver nil and I don't know why or how to fix this. The problem seems to only occur in the server script
The localscript:
workspace.World["Toolgiver"]:WaitForChild("Head").ClickDetector.MouseClick:Connect(function()
if plr.Backpack:FindFirstChild("Tool") == nil then
workspace.World["Toolgiver"]:WaitForChild("Head").event:FireServer()
end
end)
The script in ServerScriptService:
workspace.World["Toolgiver"]:WaitForChild("Head").event.OnServerEvent:Connect(function(p)
game.ReplicatedStorage.Tools["Tool"]:Clone().Parent = p.Backpack
end)

6 comments
Which toolgiver are you using? Can you send us a model of it?
oh it's one that I made. it's a model that has only one block (that being the "Head") and I put a remoteEvent inside called "event". The thing is it worked before I put it in a folder, but all of a sudden the game won't detect the Head in the model
and I put a clickdetector and a humanoid in it
Did you spell the Toolgiver name right?
also using game.Workspace is best
what I get in the output is
Infinite yield possible on 'Workspace.World.Toolgiver:WaitForChild("Head")'