Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Play() weird error?

Asked by 8 years ago

Hi guys!

function playgamesong()
    local gamesong = game.Workspace.GameMusic:GetChildren()
    randomgamesong = gamesong[math.random(1,#gamesong)]
    randomgamesong:Play()
end

This function usually works, but when I run it, it randomly says: Play( )is not a valid member of playgamesong()

Any ideas? Thanks

0
Try printing the ClassName of randomgamesong and see what it says if the error shows up. Spongocardo 1991 — 8y
0
Okay, this script is inside the model where you're playing it. and it will try to play the script which it can't. HungryJaffer 1246 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Only idea I can think is there's a child inside the model that's not a sound.

0
Nope :/ jjwood1600 215 — 8y
0
try to put the sound in workspace and redo the script DarwinYork 85 — 8y
Ad

Answer this question