I made a musicplayer and i'm scripting a skip key for myself as owner but it's not fully working Could ya help me?

local uis = game:GetService("UserInputService")
OwnerID = 111775746
Allowed = false
SoundIds = {"467472854", "480549504", "452568391", "445016785", "300349736", "513915444", "519212132"}
local Sound = game.Workspace:FindFirstChild("Sound")
Current = SoundIds[math.random(1,#SoundIds)]

local value = workspace.MusicPlayer:FindFirstChild("ID")


game.Players.PlayerAdded:connect(function(player)
   if player.UserId == OwnerID then
	 Allowed = true
end
end)


uis.InputBegan:connect(function(inst)
   if Allowed == true and inst.KeyCode == Enum.KeyCode.K then
       Sound.SoundId = "http://www.roblox.com/asset?id="..SoundIds[math.random(1,#SoundIds)]
	
    end
end)

1 comment

1

Is sound getting set to 'nil' by any chance?