I was trying to make a script that plays random audio OnClicked and when i tested it, it didnt work. Can someone tell me how to fix the problem?
hull = script.Parent.Parent.Hull
audios = math.random(0.2)
function onClicked()
script.Parent.CFrame = CFrame.new(4.927, 41.072, -23.83)
script.Parent.Parent.ON.CFrame = CFrame.new(4.927, 30.672, -23.83)
script.Parent.Parent.ON.SurfaceLight.Enabled = true
script.Parent.Parent.ON.Script.Disabled = false
script.Parent.Parent.Buttons.Sound:Play()
if audios == 0.1 then
hull.Static:Play()
end
if audios == 0.2 then
hull.HN:Play()
end
script.Disabled = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

3 comments
But, i need them to play inside the model but not in workspace.
Nevermind, i managed to make the audios play inside of the model.
Yes, the folder was just a sample on how you would store your sounds.