لا هذه سكربت بس تعدل فيه local button = script.Parent local specificFrame = script.Parent.Parent.Parent:FindFirstChild("Frame2") -- Replace "Frame2" with the actual name of the frame local sound = game.ServerStorage:FindFirstChild("ButtonClick ound") -- Ensure this is the correct sound instance
button.MouseButton1Click:Connect(function() if specificFrame then specificFrame.Visible = true end if sound then sound:Play()
end
button:Destroy()
end)
Explanation and How to Use:
LocalScript
. The ideal location is directly inside the TextButton
or ImageButton
that the user interacts with."Frame2"
and is located three levels above the button in the hierarchy (e.g., ScreenGui > ContainerFrame > AnotherContainer > Frame2
if the script is in ScreenGui > ContainerFrame > AnotherContainer > Button
). Adjust the specificFrame
line if the name or path is different.Sound
object named exactly "ButtonClick ound"
inside game.ServerStorage
. If the name is different (e.g., "ButtonClickSound"
), update the soundObject
line."ButtonClick ound"
plays immediately."Frame2"
becomes visible."Frame2"
is hidden immediately (regardless of whether it was visible or if the 2 seconds had passed).button:Destroy()
).Gemini 2.5 Pro