help somebody it wont load ANY sound.
local plr = game.Players.LocalPlayer
local char = plr.Character
local root = char:WaitForChild("HumanoidRootPart")
local ContentProvider = game:GetService("ContentProvider")
local id = "rbxassetid://1209600026" -- set id to audio you want
local play
local preload = Instance.new("Sound")
preload.SoundId = id
local t = {
["walk"] = {2, 5} -- name = {start pos, length, [optional] location, [optional] properties}
--[[ properties
ie:
Volume : 5,
MaxDistance : 10000
]]
}
ContentProvider:PreloadAsync({id}, function(content, status)
if status == Enum.AssetFetchStatus.Success then
play = function(n)
spawn(function()
local sound = Instance.new("Sound", #t[n] >= 3 and t[n][3] or game:GetService("Workspace"))
if #t[n] == 4 then
for i,v in pairs(t[n][4]) do
sound[i] = v
end
end
sound.SoundId = content
sound:Play()
wait(t[n][2] * sound.PlaybackSpeed)
sound:Stop()
end)
end
else
warn("Error loading assets")
print(content)
end
end)
wait(1)
play("walk")
wait(1)
play("walk")
script by @JayzYeah32
Errors: