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

Why does the boombox stop playing music when uneqipped?

Asked by
Seyfert 90
7 years ago

Is there a way I could make the boombox gear from Roblox toolless or play while it is uneqipped (The music plays from the tool's "Handle" so even if I unequip it, the sound stays where I last unequipped it instead of following the player). I want it so that I can have another tool equipped and the boombox still playing music.

0
This is a request. We are not a request website. Link150 1355 — 7y

1 answer

Log in to vote
-2
Answered by 7 years ago
Edited 7 years ago

This is an alternative to using the boombox, this is much more efficient. Also, you can use any tool while this is here.

local gui = Instance.new("ScreenGui")
gui.Parent = script.Parent
wait()
local frame = Instance.new("Frame")
frame.Parent = script.Parent.ScreenGui
frame.Position = UDim2.new(1, -400, 1, -35)
frame.Size = UDim2.new(0, 250, 0, 30)
frame.BackgroundTransparency = 0.5
wait()
local text = Instance.new("TextBox")
text.Parent = script.Parent.ScreenGui.Frame
text.Position = UDim2.new(0, 2, 0, 2)
text.Size = UDim2.new(1, -96, 1, -4)
text.BorderSizePixel = 0
text.Text = "Music ID here"
wait()
local play = Instance.new("TextButton")
play.Parent = script.Parent.ScreenGui.Frame
play.Position = UDim2.new(1, -96, 0, 1)
play.Size = UDim2.new(0, 46, 1, -2)
play.BorderSizePixel = 0
play.Text = "Play"
play.BackgroundColor3 = BrickColor.Green().Color
play.Name = "Play"
wait()
local stop = Instance.new("TextButton")
stop.Parent = script.Parent.ScreenGui.Frame
stop.Position = UDim2.new(1, -48, 0, 1)
stop.Size = UDim2.new(0, 46, 1, -2)
stop.BorderSizePixel = 0
stop.Text = "Stop"
stop.BackgroundColor3 = BrickColor.Red().Color
stop.Name = "Stop"
wait()
local sound = Instance.new("Sound")
sound.Parent = script.Parent
sound.Name = "Music"
function play()
    script.Parent.Music.SoundId = "rbxassetid://"..script.Parent.ScreenGui.Frame.TextBox.Text
    script.Parent.Music:Play()
end
script.Parent.ScreenGui.Frame.Play.MouseButton1Click:connect(play)

function stop()
    script.Parent.Music:Stop()
end
script.Parent.ScreenGui.Frame.Stop.MouseButton1Click:connect(stop)

Put that chunk of code in a LocalScript in StarterGui. This will give each player their own personal music player! Hope this helped, if it did then please up-vote this answer.

0
This was immensely helpful, it works great thank you so much, I would really be stuck without this. You really helped me closer to achieve one of my dreams, thank you! Seyfert 90 — 7y
0
Commenting again. not sure why you were downvoted, I would upvote you if I could but it doesn't let me. Some people are just very selfish. Seyfert 90 — 7y
0
Learn how to accept answers. User#11440 120 — 7y
0
I know people are selfish, nor should they have the right to downvote an answer that wasnt even for them. Those kind of people are just ridiculous. And I'm glad it worked out for you :) Connor_1 3 — 7y
View all comments (3 more)
0
Bad. ScriptGuider 5640 — 7y
0
No, upvotes and downvotes exist to rate the quality of an answer. The best answers are then raised up while the worst answers go down. Link150 1355 — 7y
0
I understand how they work, but its pretty pathetic that you guys would just spam like that. I gave him a good answer that he accepted, it might not be what he wanted, but it was a quality answer. Connor_1 3 — 7y
Ad

Answer this question