Egg not being collected?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want the egg, so if it is touched, it will play a function, and then check if the egg is in the ServerStorage, and if it is, wait for 1 to 10 minutes, and then put it back to the workspace.

  2. What is the issue?
    The sound plays without me even touching it, and if I touch the egg, nothing happens.

When I run the script, I get these errors:
22:44:36.270 - Attempt to connect failed: Passed value is not a function
22:44:36.271 - Stack Begin
22:44:36.271 - Script ‘Workspace.Eggs.CommonEggs.StarterEggs.StarterEgg.Script’, Line 10
22:44:36.271 - Stack End
22:45:59.471 - attempt to call a nil value

  1. What solutions have you tried so far?
    I have not tried any solutions.
local function playVictory(obj)
	script.Parent.Victory:Play()
	script.Parent.VictoryGui.Enabled = true
	wait(script.Parent.Victory.TimeLength)
	script.Parent.VictoryGui.Enabled = false
    script.Parent = game.ServerStorage.Eggs.CommonEggs.StarterEggs
end

while true do 
	script.Parent.Touched:Connect(playVictory())
	 if script.Parent == game.ServerStorage.Eggs.CommonEggs.StarterEggs then
		wait(math.random(60, 600))
		  script.Parent = game.Workspace.Eggs.CommonEggs.StarterEggs
	end
end

It’s supposed to be :Connect(playVictory) not :Connect(playVictory()). But you also shouldn’t run that connection in the while true do loop.

Then how can I detect if someone is touching the egg?

just put the connection right before starting the while true do loop. It’ll still work if you keep it in the loop, just won’t be as “proper” as putting it out of the loop.

Now there is 23:28:39.780 - Script timeout: exhausted allowed execution time.

It also goes to script.Parent = game.Workspace.Eggs.CommonEggs.StarterEggs

You need to put a wait() outside of the if statement