Hello!
I was figuring out how to use RevScripts in Revscriptsys · otland/forgottenserver Wiki but I stumbled upon a doubt that I couldn't resolve, could you help me?
I am trying to make a test on-hit effect, where when you hit a creature with a specific weapon, a thunder effect will happen. But as my server version supports sounds already, I wanted to make a thunder sound happen too. I already managed to do the thunder effect and the proc function, however, I'm still unable to produce sound, what is the function to call sounds?
I was figuring out how to use RevScripts in Revscriptsys · otland/forgottenserver Wiki but I stumbled upon a doubt that I couldn't resolve, could you help me?
I am trying to make a test on-hit effect, where when you hit a creature with a specific weapon, a thunder effect will happen. But as my server version supports sounds already, I wanted to make a thunder sound happen too. I already managed to do the thunder effect and the proc function, however, I'm still unable to produce sound, what is the function to call sounds?
LUA:
local on_hit = CreatureEvent("PlayerOnHit")
function on_hit.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
local weapon = attacker:getSlotItem(CONST_SLOT_LEFT)
local creature_position = creature:getPosition()
-- Thunder God Rage --
if weapon.itemid == 3271 then
print("Thunder God Rage - PROC!")
creature_position:sendMagicEffect(CONST_ME_ENERGYHIT)
creature_position:sendSound(SOUND_EFFECT_TYPE_SPELL_LIGHTNING) -- This does not work unfortunately :c
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
on_hit:register()