Universal Script 📌
1.1k Views
2.5k Executions

Music id script

Universal Script 📌
Kyelisz
KyeliszPublished 10
8 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

a script that plays any sound of your will THIS IS VISUALS ONLY YOU CAN HEAR THIS

View Raw
-- Configuration
local SOUND_ID = "rbxassetid://17594884733" -- Replace with your actual sound ID i just put a knocking sound for now 
local PLAY_DURATION = 6.999999999999 -- seconds

-- Create or get the Sound object
local sound = Instance.new("Sound")
sound.SoundId = SOUND_ID
sound.Volume = 1 -- Adjust volume (0 to 10)
sound.Looped = false
sound.Parent = game.Workspace -- You can parent it to a part or UI element

-- Function to play and stop the sound
local function playAndStopSound()
    -- Safety check
    if not sound.SoundId or sound.SoundId == "" then
        warn("No valid SoundId set.")
        return
    end

    -- Play the sound
    sound:Play()

    -- Wait for the specified duration
    task.wait(PLAY_DURATION)

    -- Stop the sound
    if sound.IsPlaying then
        sound:Stop()
        print("Sound stopped after " .. PLAY_DURATION .. " seconds.")
    end
end

-- Run the function
playAndStopSound()


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Universal Script 📌
3.1k
24.2k
Bumped 12 minutes ago
Script hub
6.8k
42.1k
Bumped 35 minutes ago

Script hub

TLMenu

Script hub
47
29
3 hours ago
Key System
Script hub
1.8M
460.8k
Bumped 4 hours ago
Key System

Script hub

#5 today

Verified script badgeAxonic Hub | 50+ Games Supported

Universal Script 📌
634
1.4k
Bumped 5 hours ago
Universal Script 📌
82
245
Approved 5 hours ago
Script hub
64
12
Approved 5 hours ago