hello, basically im trying to preload the sound to play it, but when i add the preloadasync line, it just gives error, let me provide script and error
local player = game.Players.LocalPlayer
local sound = game.ReplicatedStorage.sounds.StandSound
game:GetService("ContentProvider"):PreloadAsync(sound.SoundId)
sound.Loaded:Connect(function()
print("yes")
for i, v in pairs(workspace.Builds.spawn.stands:GetChildren()) do
v.ClickDetector.MouseClick:Connect(function(plr)
if player == plr then
local clonedsound = sound:Clone()
clonedsound.Parent = v
clonedsound.Playing = true
game:GetService("Debris"):AddItem(clonedsound, 1.118)
end
end)
end
end)
Unable to cast to Array - Client - standsoundscript:4
thanks