- What do you want to achieve? I am making a egg hatching system
- What is the issue?
if player:DistanceFromCharacter(nearestEgg.EggMesh.PrimaryPart.Position) < MaxDisplayDistance then
canHatch = true
else
canHatch = false
end
if canHatch == true then
local result = replicatedStorage:WaitForChild("EggHatchingRemotes"):WaitForChild("HatchServer"):InvokeServer(nearestEgg)
if result ~= nil then
print("hatch")
hatchOne(result, nearestEgg)
end
else
print("Cannot Hatch")
end
end
end
end)
when i press the error it shows up this line replicatedStorage:WaitForChild(“EggHatchingRemotes”):WaitForChild(“HatchServer”):InvokeServer(nearestEgg)
the error says ServerScriptService.Egg_System.Main_Server:5: attempt to index number with number
i get this error whenever i go to the egg and press E to hatch the animation doesnt show because of the error of “index number with number”