@ Tarkus
I've tried this script and it works fine in test game.
ATTACH TO THE DOOR
-- Door opens if door entity has been activated (e.g. by keypad)
g_unloked = 0
function doorforkeypad1_init(e)
end
function doorforkeypad1_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 then
if g_unloked == 0 then
Prompt("The door is locked. Enter the correct key code to open door.")
end
if g_unloked == 1 then
SetAnimation(0)
PlayAnimation(e)
PlaySound(e,0)
g_unloked = 2
end --g_g_unloked
if g_unloked == 2 and GetTimer(e) > 1000 then CollisionOff(e) end
end -- PlayerDist
end --main
Notice it already has the g_ prefix.
TO CHANGE IN YOUR KEYPAD SCRIPT
if g_numberpadPressQuantity == 5 then
--Open door for example
g_unloked = 1
--ActivateIfUsed(e)
end
Do not using "if Used" field here, just a global var.
I also have the keypad script with all the g_ prefixes working fine, if you want I can send you via email.
Sorry I've tried to test in standalone,
but I'm having issues with standalone.
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4