nope, open a blank text file (in notepad is fine)
copy the entire code snippet into it
local health = {}
--weapon number to trigger the sound effect from slot 0
--set to 0 to play the sound for all damage
local weapon = 12
function break_object_init(e)
end
function break_object_main(e)
if health[e] == nil then
health[e] = g_Entity[e]['health']
else
if health[e] > g_Entity[e]['health'] then
if g_PlayerGunID == weapon or weapon == 0 then
PlaySound(e,0)
end
health[e] = g_Entity[e]['health']
end
if g_Entity[e]['health'] < 1 then
Hide(e)
CollisionOff(e)
Destroy(e)
end
end
end
function break_object_exit(e)
if g_PlayerGunID == weapon or weapon == 0 then
PlaySound(e,0)
end
end
save it as
Quote: "break_object.lua"
(note: not .txt)
open your gameguru folder and find the scriptbank folder and copy/paste the file you created inside
now when in game guru editor right click the wooden barrier and assign the script to it, give it some HP and give it a sound effect at slot 0
to find the weapon ID number for the weapon you are holding you use
Prompt(g_PlayerGunID)
inside the main(e) part of the code - i'm not sure if everyone gets the same values or how it is worked out.
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11