I want to make one of the sounds play when I open the store but it doesn't work
local sound1 = script.Parent.Sound1
local sound2 = script.Parent.Sound2
local sound3 = script.Parent.Sound3
local sounds = {
sound1,
sound2,
sound3
}
local function shopMenu(otherPart)
local player = game.Players:FindFirstChild(otherPart.Parent.Name)
local chosenSound = sounds[math.random(1, #sounds)]
local sound = script.Parent:WaitForChild(chosenSound) -- define your sound
if player == LPlayer then
player.PlayerGui.ScreenGui.Shop.Visible = true
sound:Play()
player.Character.Humanoid.WalkSpeed = 0
end
end
Close Shop Lines:
local function closeMenu()
if ting == 0 then
ting = 1
LPlayer.PlayerGui.ScreenGui.Shop.Visible = false
script.Parent.Goodbye:Play()
LPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(close.Position.X,close.Position.Y + 3,close.Position.Z)
LPlayer.Character.Humanoid.WalkSpeed = 16
wait(1)
ting = 0
end
end

1 comment
This question was solved. Can you answer my recent question please? (If you can)