RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"write a gui button script that has an image as the gui and when clicked plays an audio"
-- local script (StarterGUI) local player = game.Players.LocalPlayer local screenGui = Instance.new("ScreenGui", player.PlayerGui) local imageButton = Instance.new("ImageButton", screenGui) imageButton.Image = "rbxassetid://your_image_asset_id" imageButton.BackgroundTransparency = 1 imageButton.Size = UDim2.new(0, 100, 0, 100) local audio = Instance.new("Sound", screenGui) audio.SoundId = "rbxassetid://your_audio_asset_id" imageButton.MouseButton1Click:Connect(function() if not audio.Playing then audio:Play() end end)