I am trying to play a sound when a Text Button is clicked
game.StarterGui.ScreenGui.Frame.bassattackbutton.Activated:Connect(function() game.Workspace.bassattack:Play() end)
The output doesnt put out any error nor does the sound play.
First of all, you need to get the button that is in the player's PlayerGui, not the StarterGui.
Also a TextButton has a MouseButton1Click event you can use to detect when the button is clicked.
local Player = game.Players.LocalPlayer local PlayerGui = Player.PlayerGui local Button = PlayerGui:WaitForChild("ScreenGui"):WaitForChild("Frame"):WaitForChild("bassattackbutton") Button.MouseButton1Click:Connect(function() game.Workspace.bassattack:Play() end)