My Script:
--Переменные:
local Timer = 0
function se_waterfall_init(e)
package.path = "scriptbank/?.lua;"
require "omegacore"
ocAUCreate()
for i=1, 6, 1 do
sndWater[i] = ocAULoadSound("audiobank/sound_engine/waterfall" .. i .. ".wav")
ocAUSetSoundRange(sndWater[i], 100.0, 1000.0)
ocAUSetSoundVolume(sndWater[i], 100.0)
ocAUSetSoundPosition(sndWater[i], g_Entity[e]['x'], g_Entity[e]['y'], g_Entity[e]['z'])
end
end
Example of script(Author: tomjscott):
-- sound handles
sndFire = -1;
sndBirds = {};
sndAmbient = -1;
local firstTime = 1;
function auplayer_init(e)
package.path = "scriptbank/?.lua;"
require "omegacore"
ocAUCreate();
sndFire = ocAULoadSound("audiobank/other/fire.wav");
ocAUSetSoundRange(sndFire, 50.0, 500.0);
sndAmbient = ocAULoadSound("audiobank/atmospheric/Desert.wav");
ocAUSetSound2D(sndAmbient);
ocAUSetSoundVolume(sndAmbient, 25.0);
for i=1,4,1 do
sndBirds[i] = ocAULoadSound("audiobank/other/bird" .. i .. ".wav");
ocAUSetSoundRange(sndBirds[i], 50.0, 750.0);
end
end
Why do I get the error "nil"? I made the same way.