Hello, i trys now for 3 days to figure it out how i can finish this script and i hope somebody can help me. I just want that if i come to a npc i press E and a Panel goes on and i can read what the NPC says and if i press E again i need that the Panel close. I have try myself i get the planel open and can read the text but i need to press all time E, that means i holding the E button and can read it. But thats not i want. I hope somebody can help me to figure it out. Thank you
CODE :
local PlayerDist_near = 100;
local PlayerDist_far = 100;
local sat = {}
PlayerDist = GetPlayerDistance(e)
if PlayerDist <= PlayerDist_near then
Prompt ( "Press E to talk" )
if g_KeyPressE == 1 then
Panel(25,40,75,60)
TextCenterOnXColor(50,45,1, "Hello" ,100,255,100)
PromptTextSize(4)
end