A big mystery is going on in this script as the sound marked isn't playing, whilst the other one is playing, the funny thing is that there is no error in the output and neither in the Developer Console (F9) and it is working perfectly in studio but not in game/server.
Everything is working properly except for the sound part.
script.Parent.Touched:connect(function(hit)
if DB == false and hit.Parent:FindFirstChild("Humanoid")~=nil then
DB = true
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats.Value == false then
leaderstats.Value = true
script.Parent:WaitForChild("Good"):Play()-- NOT WORKING
owner.Value = player.Name
script.Parent:Destroy()
else
script.Parent:WaitForChild("Bad"):Play()--WORKING
end
wait(0.5)
DB = false
end
end)

1 comment
I made the leaderstats a bool value so I use the bool to check if the player owns a tycoon or not. :/