Hi I’m trying to make a boombox for my game but it isn’t working. I need to find a child called “PlaySong” but I can’t find it. I tried .Child, WaitForChild, and FindFirstChild but it always resulted in nothing, errors, or infinite yields. Here is my codez;
Client:
local PlaySong = script.Parent.PlaySong
local Tool = script.Parent
local Backpack = script.Parent.Parent
local PlayerGui = script.Parent.Parent.Parent.PlayerGui
Tool.Equipped:Connect(function()
for i, v in pairs(PlayerGui.Gui:GetChildren()) do
v.Visible = true
end
end)
Tool.Unequipped:Connect(function()
for i, v in pairs(PlayerGui.Gui:GetChildren()) do
v.Visible = false
end
if script.Parent:FindFirstChild("Sound") then
print(script.Parent.Sound.Name)
script.Parent.Sound:Destroy()
end
end)
PlaySong:
local Backpack = script.Parent.Parent.Parent.Parent.Backpack
local Boombox = Backpack.Boombox
local PlaySong = Boombox:FindFirstChild("PlaySong")
local ID = script.Parent.Parent.ID.Text
local Handle = Boombox:FindFirstChild("Handle")
Boombox.PlaySong:FireServer(Handle, ID)
print("Fired Server")
Server:
local Backpack = script.Parent.Parent.Parent.Parent.Backpack
Backpack.Boombox.PlaySong.OnServerEvent:Connect(function(Player, Handle, ID)
local Sound = Instance.new("Sound", Handle)
Sound.SoundId = ("rbxassetid://"..ID)
Sound:Play()
print(Sound.Name, Sound.Parent, "Working", Sound.SoundId)
end)
I can provide additional information if needed. Please help.