Thanks smallg, unfortunately it doesn't work, nothing happens when you shoot the wall i'm using, i've tried it on stock doors too and nothing.
Anyway, i've given up with the killing bit, and i'm just going to do a press E to shove the wall script instead, i've adapted your script above, which works perfectly, however if i put a second object in the level with that script the second one shows the prompt, and turns the collision off when you hit E, but doesn't animate.
function kaboom_init(e)
SetActivated(e,97)
end
function kaboom_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 and g_Entity[e]['activated'] == 97 then
Prompt("The wall looks weak. Press E to give it a shove")
if PlayerDist < 100 and g_KeyPressE == 1 then
SetActivated(e,98)
SetAnimation(e,0)
PlayAnimation(e)
g_Entity[e]['animating'] = 98
end
elseif g_Entity[e]['activated'] == 98 then
if g_Entity[e]['animating'] == 0 then
CollisionOff(e)
SetActivated(e,99)
end
end
end
Any ideas?
Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.
Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.
Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.