i’m making a system where a sound plays everytime a checkpoint is touched. However, the first time when I touch a checkpoint, the sound plays. Then, the next time, it doesn’t play and says it doesn’t have access. Failed to load sound rbxassetid://18306586465: User is not authorized to access Asset.
Any information on how I would go about fixing this would be greatly appreciated!
Hey there! Can I see the script on how you make the sound play? Also I checked the asset and the creator is unverified so that may be part of the problem
Most likely it’s not a public sound or not a sound owned by you. If it’s a sound from a group you own or you own and using it in a group, you’ll have to go into that sounds setting, and enable it being able to be use publicly. Else if it’s a sound privately own from a different game/group/player you won’t be able to use it. Hope this helps.
I see, so I only have to use a sound from a verified creator?
Also the script:
--server script
local touched = {}
for i, v in ipairs(workspace:GetDescendants()) do
if v:FindFirstChild("CheckpointValue") then
v.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local checkpointNum = v:FindFirstChild("CheckpointValue").Value
local checkpointName = v.Name
local checkpointColor = v.BrickColor.Color
if plr.Character:FindFirstChild("CheckpointValue").Value < checkpointNum then
plr.Character:FindFirstChild("CheckpointValue").Value = checkpointNum
plr.Team = game.Teams:FindFirstChild(checkpointName)
if table.find(touched, plr.UserId) then
return
else
game:FindFirstChild("ReplicatedStorage"):FindFirstChild("CheckpointMessage"):FireAllClients(plr, checkpointName, checkpointColor)
table.insert(touched, plr.UserId)
game:FindFirstChild("ReplicatedStorage"):FindFirstChild("PlaySound"):FireClient(plr, game:FindFirstChild("ReplicatedStorage"):FindFirstChild("CheckpointSound"))
--line above is where i send a remote event to the client to play the sound ^^^
end
end
end
end)
end
end
--local script
game:FindFirstChild("ReplicatedStorage"):FindFirstChild("PlaySound").OnClientEvent:Connect(function(sound)
print('received')
print('its our player')
print(sound)
local s = sound:Clone()
print('cloned')
s.Parent = game.Players.LocalPlayer.PlayerGui
print('parented')
s:Play()
task.wait(s.TimeLength + 0.75) --delay so the sound truly finishes playing
s:Destroy()
end)
No, just sometimes it is a banned or private asset that can’t be accessed in studio. I thought that would be your problem, but I don’t think it is anymore.
I’m thinking you might want to add a debounce so that you can’t play the same sound twice from the same checkpoint. Also, testing it in the Roblox client, not studio, might fix your issue but I’m not sure