Jump to content

Sound


Tekken

Recommended Posts

This script should play zombies moan. But nothing hapend :(

Client

local zombies = getElementsByType ( "ped" ) 
   for theKey,theZomb in ipairs(zombies) do 
       if (isElement(theZomb)) then 
           if (getElementData (theZomb, "zombie") == true) then 
                setPedVoice(theZomb, "PED_TYPE_DISABLED") 
           end 
       end 
end 
  
addEvent( "Zomb_Moan", true ) 
function Zmoan ( ped, randnum ) 
    if (isElement(ped)) then 
        local Zx,Zy,Zz = getElementPosition( ped ) 
        local sound = playSound3D("sounds/mgroan"..randnum..".ogg", Zx, Zy, Zz, false) 
        setSoundMaxDistance(sound, 20) 
    end 
end 
addEventHandler( "Zomb_Moan", getRootElement(), Zmoan ) 

Server

function zmoan(zombie) 
    if moancount < moanlimit then 
        moancount = moancount+1 
        local randnum = math.random( 1, 10 ) 
        triggerClientEvent ( "Zomb_Moan", getRootElement(), zombie, randnum ) 
        setTimer ( ReduceMoancount, 800, 1 ) 
    end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...