User Tools

Site Tools


developer_center:developer_editor:script:developer_center_script_world_playsoundeffectonpos

World:playSoundEffectOnPos()

Parameters :

  • Table Position : table must contain named index of x,y,z with type of value is Number
  • Volume : Number of Volume
  • Pitch : Tone of the Sound effect;
  • isLoop : Boolean Value;

Return Value :

  • Error.Code : 0 = OK , 1001 = failed

Code Example :

-- Store the ID of Sound Effect into a Table
local soundEffect = {
    explosion = 10538
}
-- Simplify the Function for Easier Call
local function playSoundOnPos(x,y,z,whatsound,volume) 
    World:playSoundEffectOnPos({x=x,y=y,z=z}, whatsound, volume, 1, false)
end 
 
-- Example of Usage 
playSoundOnPos(10,10,0,soundEffect,100);
developer_center/developer_editor/script/developer_center_script_world_playsoundeffectonpos.txt · Last modified: 2024/06/28 16:41 by hhuxx