Before you open the box you need to StartTimer(boxEntity)
but you will need something like this:
local TimerSet = 0
local boxOpen = 0
function open_with_hint_init(e)
end
function open_with_hint_main(e)
if GetPlayerDistance(e) <= 150 then
if boxOpen == 0 then -- Box closed
if TimerSet == 0 then -- Timer not set..
StartTimer(e)
TimerSet = 1
end
if GetTimer(e) >= 2000 then -- You can play with this number until it is right,,
Prompt("Put your hint here")
if g_KeyPressE == 1 then
SetAnimation(0)
PlayAnimation(e)
CollisionOff(e)
boxOpen = 1 -- Box Open..
end
else
Prompt("Press E to open the box")
if g_KeyPressE == 1 then
SetAnimation(0)
PlayAnimation(e)
CollisionOff(e)
boxOpen = 1 -- Box Open..
end
end
end
end
end
Hope this helps
HP Pavilion Laptop, AMD A8-4555M APU with Radeon(tm) Graphics HD Graphics 1.6GHz, 8GB Memory, 64 Bit Operating System (Windows 10), 1 TB Hard Drive.
I've got something to say - It's better to burn out than fade away.