local rep = game:GetService("ReplicatedStorage")
local moduleee = require(rep:WaitForChild("EggModule_Server"))
wait(5)
for _, egg in pairs, (game.Workspace.Eggs:GetChildren()) do
local p = moduleee.SetUpTheEgg(egg.Name)
p.Triggered:Connect(function(plr)
moduleee.EggHatch(plr, egg.Name)
end)
end
Module Script:
local plrs = game:GetService("Players")
local repsto = game:GetService("ReplicatedStorage")
local eggs = game.Workspace:WaitForChild("Eggs")
local module = {}
function module.EggHatch(plr, eggName)
print("o")
end
function module.SetUpTheEgg(eggName)
local egg = eggs:FindFirstChild(eggName)
if egg and egg:FindFirstChild("Hitbox") then
local p = script.ProximityPrompt:Clone()
p.Parent = egg:FindFirstChild("Hitbox")
return p
end
end
return module
At the bottom of the picture you can see ReplicatedStorage.EggModule_Server which means the error is coming from the module. You can also see EggModule_Server:15. The 15 is the line number the error is on. From what I can tell the error is coming from this specific line if egg and egg:FindFirstChild("Hitbox") then unless you added whitespace lines.