Okay this script is cloned to the LocalPlayer in game. so when he joins the game, a regular script clones this LocalScript gets into him.

The soundid it should play from is inside the player too which gets cloned from the regular script in the workspace too.

Now the script doesn't work, it won't play songs

no errors, nothing.

P.S i removed the songs so no one can look it up on the web. :)

local Songs = {0,0}
local Play = true
local ID = 000000

function New()
	ID = nil
	ID = Songs[math.random(1,#Songs)]
end

game:GetService("RunService").Heartbeat:connect(function()
	if Play==true then
		New()
		Play=false
		game.Players.LocalPlayer.Song:Stop()
		game.Players.LocalPlayer.Song.SoundId=""..ID
		wait()
		game.Players.LocalPlayer.Song:Play()
		wait(game.Players.LocalPlayer.Song.TimeLength)
		game.Players.LocalPlayer.Song:Stop()
		Play=true
	end
end)

5 comments

0

Maybe you have to wait for the song to load (Takes time depending on how big the game is and wifi signal)

0

no, lol if i put the script into the startergui it works, but i don't need it to be in startergui everytime u die it resets the song and makes it buggy, also i dont use wifi

0

anyone ?..

0

This is a simple fix. If only you had explained it better, someone could have helped you determine the issue

0

Its never possible to explain i dont get it how could i explain then. I tried my all..... All i can say it wont play songs in the player