i have a script where in the middle of the script there is a function that starts like this:
function play()
print("playing...")
it never says "playing..."
and i have put a play() at the bottom
full code:
local loop_phase = 1
local playing = false
local id = script.Id
while true do
wait()
if playing then
if loop_phase == 1 then
print("now playing: "..id.Value..".start")
script.Library[id.Value].start:Play()
wait(script.Library[id.Value].start.TimeLength)
loop_phase = 1
elseif loop_phase == 2 then
script.Library[id.Value].loop:Play()
wait(script.Library[id.Value].loop.TimeLength)
end
end
end
function play()
print("playing...")
for i=0,50,1 do
wait(0.01)
if loop_phase == 1 then
script.Library[id.Value].start.Volume = script.Library[id.Value].start.Volume - 0.2
elseif loop_phase == 2 then
script.Library[id.Value].loop.Volume = script.Library[id.Value].loop.Volume - 0.2
end
end
playing = false
if loop_phase == 1 then
script.Library[id.Value].start:Stop()
elseif loop_phase == 2 then
script.Library[id.Value].loop:Stop()
end
script.Library[id.Value].loop.Volume = 10
script.Library[id.Value].start.Volume = 10
loop_phase = 1
playing = true
end
play()
the local id = script.Id is a string value set to "adventure"
the script will locate: script.Library[id.Value]["start"] at some point which basicly means script.Library.start
and start is a sound in a folder called adventure in the script
no errors, or the "playing..." i seriously need help

2 comments
Because you have a loop and until that loop ends you cannot do anything...
its working fine now, thanks! (i have learned something very important: loops that never end should come last)