I have created a sound in the Player through the Developer Console and that played, however when I later created a module script so I could require the script through the Developer Console, the sound did not play.
However, I ran the same script in the command bar in studio and the sound did play. If I am not mistaken the play solo in studio now behaves like the server, yet this worked in studio but not in game, yet if it were to be scripted without the module script it in the developer console, the sound plays.
I am confused at what I could be doing wrong as sound:Play() does not seem to be triggering through my module script which is required through the Developer Console, yet I am not being given any error.
If I ran this in the Developer Console it works
function create(player)
local URL = "rbxassetid://"
local ScreenGui = Instance.new("ScreenGui")
local Sound = Instance.new("Sound", ScreenGui)
Sound.Looped = true
Sound.Volume = 1
Sound.SoundId = URL..147758618
ScreenGui.Parent = game.Players:FindFirstChild(player).PlayerGui
Sound:Play()
end
create("Roy_Mer")
However if I ran the same script through a module script in the Developer Console, Sound:Play() is not triggering in game but it does trigger in studio.
local roymer = require(123456)
roymer.create(playerName)
Apparently Sound.IsPlaying is true and Sound.Volume is 1, yet I still cannot hear it in game?