Jump to content

setPedVoice & isElementStreamedIn errors


JanKy

Recommended Posts

Hi guys,

i get these errors in the debugscript
ERROR : zombies/sounds.lua:67: attempt to call global 'setPedVoice' ( a nil value )
ERROR : zombies/sounds.lua:75: attempt to call global 'isElementStreamedIn' ( a nil value )

And here is the script :

	function stopZombieSound()
	local zombies = getElementsByType ( "ped" )
	for theKey,theZomb in ipairs(zombies) do
		setPedVoice(theZomb, "PED_TYPE_DISABLED") -- line 67
	end
end
setTimer(stopZombieSound,1000,0)

function playZombieSounds()
local zombies = getElementsByType("ped")
	for theKey,theZomb in ipairs(zombies) do
		if theZomb and isElement(theZomb) and isElementStreamedIn(theZomb) and getElementData(theZomb,"zombie") and not getElementData(theZomb,"animal")  then -- line 75
			local Zx,Zy,Zz = getElementPosition(theZomb)
			zedSound = playSound3D(zombiesounds[math.random(1,#zombiesounds)], Zx, Zy, Zz, false)
			setSoundMaxDistance(zedSound,5)
		end
		if getElementData(theZomb,"deadman") then
			if zedSound then
				stopSound(zedSound)
			end
		end
	end
end
setTimer(playZombieSounds,6000,0)

And if i do this
 

local setPedVoice(theZomb, "PED_TYPE_DISABLED")

i get this error in the console
ERROR: Loading script failed: UNION_DAYZ/sounds/sounds.lua:67: ')' expected near ','

Some help please?
Thanks in advance.


 

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...