I'm trying to make a sound play when the player touches the sell pad but it seems to just pass through the sound no matter where I put it in the script.
No errors appear in the output, but when I made a mistake with the name it appeared in the output so I think the sound IS recognized by the script but I just don't know why it doesn't play.
code is in a server / global script.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.leaderstats.Power.Value >= 1 then
player.PlayerGui.Cash:Play()
game.ReplicatedStorage.BindableEvents.Sell:Fire(player)
end
end
end)

1 comment
This is a Server Script right? Server Scripts can't see what's inside players' PlayerGui. You'll need a Local Script for that