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

Trying to get it to play when audio in for local player?

Asked by 5 years ago

Trying to get it to play when audio in for local player

print("1")
local textbox = script.Parent 
local music = script.Parent.Music

while true do
    music.SoundId = "rbxassetid://" ..textbox.Text --What ever audio id in plays
    script.Parent.Music:Play()
end

1 answer

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago

The code you currently have plays the music constantly every fraction of a second. Which means the music will play from the beginning every fraction of a second.

Do this instead.

print("1")
local textbox = script.Parent 
local music = script.Parent.Music

music.SoundId = "rbxassetid://" ..textbox.Text
script.Parent.Music:Play()
0
Also make sure this is all in a local script somewhere localscripts can run royaltoe 5144 — 5y
0
did this work? please mark it as accepted if it works. royaltoe 5144 — 5y
Ad

Answer this question