k = Instance.new("Sound")
script.Parent.Enter.MouseButton1Click:Connect(function() if k.SoundId == "Shrek" then k.SoundId = "rbxassetid://".."2028376534" -- shrek national anthem k.Playing = true end end) script.Parent.Enter.MouseButton1Click:Connect(function() if k.SoundId == "Sans" then k.SoundId = "rbxassetid://".."2525122648" -- sans default dance k.Playing = true end end) script.Parent.Enter.MouseButton1Click:Connect(function() if k.SoundId == "AW MAN" then k.SoundId = "rbxassetid://".."1057637788" -- creepa, AW MAN. SO WE BACK IN THE MINE k.Playing = true end end)
and i also tried
. if k.SoundId == "rbxassetid://".."Shrek" then
It continuously fails to load sound ID
Failed to load sound rbxassetid://Sans: Unable to download sound data
If you use the "rbxassetid: //" then it can not be the soundid "Shrek", because it uses numbers and not stringers, ie names. Use:
local Shrek = Instance.new("Sound",script) Shrek.Name = "Shrek" Shrek.SoundId = "rbxassetid://2028376534" local k = Shrek script.Parent.MouseButton1Click:Connect(function() if k.Name == "Shrek" then print("Hey") end end)
else
script.Parent.Enter.MouseButton1Click:Connect(function() if k.SoundId == "rbxassetid://".."Shrek" then k.SoundId = "rbxassetid://".."Shrek" end end)
New:
for _,k in pairs(script:GetChildren()) do if k:IsA("Sound")then script.Parent.MouseButton1Click:Connect(function() if k.Name == "Shrek" then k.SoundId = "rbxassetid://".."2028376534" -- shrek national anthem k.Playing = true end end) script.Parent.MouseButton1Click:Connect(function() if k.Name == "Sans" then k.SoundId = "rbxassetid://".."2525122648" -- sans default dance k.Playing = true end end) script.Parent.MouseButton1Click:Connect(function() if k.Name == "AW MAN" then k.SoundId = "rbxassetid://".."1057637788" -- creepa, AW MAN. SO WE BACK IN THE MINE k.Playing = true end end) end end