Hey guys, I'm trying to make my own egg hunt game, and when you click on the eggs, a frame appears (that is my first part of the game), but this script doesn't error in the output (the output doesn't print anything about this) and the frame doesn't appear when I try clicking on the eggs.
Here is my script:
-- egg folder local eggfolder = script.Parent -- oof egg variables local eggofbloxxed = eggfolder.EggofBloxxed local oof_frame = game.StarterGui.EggGuis.OofEggGui.Frame local oofclickdetector = script.Parent.EggofBloxxed.ClickDetector1 -- normal egg variables local normalclickdetector = script.Parent.NormalEgg.ClickDetector2 local normal_egg = eggfolder.NormalEgg local normalframe = game.StarterGui.EggGuis.NormalEggGui.Frame -- normal egg clickdetector script eggfolder.eggofbloxxed.oofclickdetector.MouseClick:Connect(function() oof_frame:TweenPosition(UDim2.new(0.5, 0,0.353, 0),2.9) end) -- oof egg clickdetector script eggfolder.normal_egg.normalclickdetector.MouseClick:Connect(function() normalframe:TweenPosition(UDim2.new(0.5, 0,0.353, 0),2.9) end)
Anyone know how to solve this issue?
Thanks!
Try this, you can put this in a serverscript; if it doesn't work then check your GUI/Frame position, I tested it myself.
https://prnt.sc/s3lf8q
https://prnt.sc/s3lfl3
-- [ Variables ] -- local EggStorage = script.Parent -- Oof Egg Variables -- local EOB = EggStorage:WaitForChild("EggofBloxxed") local EOBClickdetector = EOB:WaitForChild("ClickDetector1") -- Normal Egg Variables -- local NE = EggStorage:WaitForChild("NormalEgg") local NEClickDetector = NE:WaitForChild("ClickDetector2") -- [ Events ] -- -- EggOfBloxxed -- EOBClickdetector.MouseClick:Connect(function(Player) warn(Player.Name.." has found the EggOfBloxxed!") local PlayerGui = Player:WaitForChild("PlayerGui") local EggGuis = PlayerGui:WaitForChild("EggGuis") local SpecificEggGui = EggGuis:WaitForChild("OofEggGui") local SpecificEggFrame = SpecificEggGui:WaitForChild("Frame") SpecificEggFrame:TweenPosition(UDim2.new(0.5, 0, 0.353, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.75) end) -- Normal Egg -- NEClickDetector.MouseClick:Connect(function(Player) warn(Player.Name.." has found the Normal Egg!") local PlayerGui = Player:WaitForChild("PlayerGui") local EggGuis = PlayerGui:WaitForChild("EggGuis") local SpecificEggGui = EggGuis:WaitForChild("NormalEggGui") local SpecificEggFrame = SpecificEggGui:WaitForChild("Frame") SpecificEggFrame:TweenPosition(UDim2.new(0.5, 0, 0.353, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.75) end)
Try this
-- egg folder local eggfolder = script.Parent -- oof egg variables local eggofbloxxed = eggfolder.EggofBloxxed local oof_frame = game.StarterGui.EggGuis.OofEggGui.Frame local oofclickdetector = script.Parent.EggofBloxxed.ClickDetector1 -- normal egg variables local normalclickdetector = script.Parent.NormalEgg.ClickDetector2 local normal_egg = eggfolder.NormalEgg local normalframe = game.StarterGui.EggGuis.NormalEggGui.Frame -- normal egg clickdetector script eggfolder.eggofbloxxed.oofclickdetector.MouseButton1Click:Connect(function() oof_frame:TweenPosition(UDim2.new(0.5, 0,0.353, 0),2.9) end) -- oof egg clickdetector script eggfolder.normal_egg.normalclickdetector.MouseButton1Click:Connect(function() normalframe:TweenPosition(UDim2.new(0.5, 0,0.353, 0),2.9) end)