Sound made to play through the Developer Console did not work?

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?

1 Like

If it is in the client (and FE), make sure the module script is in a location accessible to without remote events. If this is the error, move the module script into replicated storage.

This script was made to work with the developer console, in fact I am requiring the module script through the id. What I am doing should be fine as the same script works in studio through the command bar but not in game and with the recent update the play solo is said to behave the same as the server now. Also it used to work before I made it a module.

Firstly, accurate play solo (APS) has to be enabled via studio settings currently; Play Solo doesn’t respect FE by default.
Secondly, do you mind sharing your code? I don’t really understand what you’re trying to do. If it works through console without the module, I assume it’s an issue with the way you’ve set it up

1 Like

Thanks, I did not know I had to enable it myself. I edited my post and added further explanation for better understanding.

I fixed the problem I had and it was an issue with my code.

-Thread closed-