Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Any way to play user's default OS error sound?

Asked by 5 years ago

Is there any way i can signal a user's device to play it's default error sound? This is for if they have been caught exploiting.

0
Use a custom error sound because you can't check the OS the player is on. DeceptiveCaster 3761 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

I don't think that there's currently a way for you to make Roblox access the computer's sounds through scripting (probably for user security reasons), but a workaround could be to create a Sound instance when a player is caught exploiting, set the SoundId to a system sound of your choice, and then play it.

-- LocalScript

local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local SystemSoundId = 0

local function UserCaughtExploiting()
    local Sound = Instance.new("Sound")
    Sound.SoundId = "rbxassetid://"..SystemSoundId
    Sound.Parent = workspace

    Sound:Play()
end

The only problem with this method is that since there's no way to check what operating system a player is running on, there's a chance that the system sound that you choose may be inaccurate to the player's sounds.

0
Yeah. I'l stick with that. TigerManGamingYT 2 — 5y
Ad

Answer this question