hitsound_s.lua
Lua
addCommandHandler("hitsound", function(player)
if (laGetElementData ( player, "gangwarsoundon") == false) then
laSetElementData( player, "gangwarsoundon", true)
outputChatBox("Hitsound aktiviert", player)
else
laSetElementData( player, "gangwarsoundon", false)
outputChatBox("Hitsound deaktiviert", player)
end
end)
-----------------
hitsound_c.lua
Lua
addEventHandler("onClientPlayerDamage", getRootElement(),
function(attacker)
if attacker == localPlayer then
if getElementData(attacker, "gangwarsoundon") == true then
hitsound = playSound("hitsound.mp3")
setSoundVolume(hitsound, 0.3)
end
end
end
)
Benutze es auf Vio Extended das problem ist es geht ent da kommt im Debugscript
ERROR: Hitsound/hitsound_s.lua:4: attempt to call global 'laGetElementData' (a nil value)