This door are composed by 2 models, the door itself and the plasma.
Polys : 5379
texture size:
door: 2048x2048
Plasma: 512x512
I've used "door.lua" in this video.So don't forguet the key, if you want open the door with a key.
in action:
I hope you like it.
thanks for watch the video, and happy new year.
Edit: Sorry guys I forgot the script, please attached it to plasma entity.
door1.lua
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Door Prompts 'Closed' can be opened with entity collected specified by 'USE KEY'
-- state to ensure user must release E key before can open/close again
door_pressed = 0
function door1_init(e)
end
function door1_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 and g_PlayerHealth > 0 then
GetEntityPlayerVisibility(e)
if 1 then
if g_Entity[e]['activated'] == 0 then
if g_Entity[e]['haskey'] == -1 then
SetActivated(e,1)
else
if g_Entity[e]['plrvisible'] == 1 then
if g_Entity[e]['haskey'] == 1 then
Prompt("The door is locked. Press E key to unlock door")
if g_KeyPressE == 1 then
SetActivated(e,1)
end
else
Prompt("The door is locked. Find a key to unlock door")
end
end
end
else
if g_Entity[e]['activated'] == 1 then
-- door is unlocked and closed
if g_Entity[e]['plrvisible'] == 1 then
Prompt("Press E to open door")
if g_KeyPressE == 1 and door_pressed == 0 then
Hide(e)
SetActivated(e,2)
ActivateIfUsed(e)
PlaySound(e,0)
StartTimer(e)
door_pressed = 1
end
end
else
if g_Entity[e]['activated'] == 2 then
-- door collision off after 1 second
if GetTimer(e)>1000 then
CollisionOff(e)
end
end
end
end
end
end
if g_KeyPressE == 0 then
door_pressed = 0
end
--PromptLocal ( e, "activated=" .. g_Entity[e]['activated'] .. "PlayerDist=" .. PlayerDist .. " plrvisible=" .. g_Entity[e]['plrvisible'] .. " haskey=" .. g_Entity[e]['haskey'] )
end
Download link:
https://drive.google.com/file/d/0B514LwQgNiwHb3dvekQ3NlRfVUk/view?usp=sharing
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