You can write your topic however you want, but you need to answer these questions:
-
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. -
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
-
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