This is pretty much my first time looking into .lua scripting for GameGuru and I wanted to try to make it so that when a character/entity specifically the ai_fantasycharacter as that is what I have been try to get to work. Basically, I have said I wanted to try to add some sort of sound effect to the death of that entity. I was focusing on the
"function ai_fantasycharacter_exit(e)" part of the ai_fantasycharacter.lua.
This is the function :
function ai_fantasycharacter_exit(e)
PlaySound(e,DeathSound[e])
PlaySound(DeathSound[e])
CollisionOff(e)
end
I have tried the PlaySound(DeathSound[e]) and the PlaySound(e,DeathSound[e]) but neither work and they both show errors when attempting to run the lua. I tried using DeathSound[e] = sound1 then applying Sound1 to be the location of the sound file.
I have seen PlaySound used before and I also looked at Prompt(textinzone_name[e]) Which used the Name box in the properties of a trigger zone as the text to display on screen. I tried to use these two things to construct the attempt I made at trying to make a death sound, but I haven't any more ideas on how to get it to work.