I am fooling around with a prompt script, I have it fully working, where the player presses E next to an object and a text prompt appears. What I want is that the prompt
only appears if the player is looking directly
at the item and
then presses E. Is this possible?
Fyi, this is the code I have thus far:
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Press E Prompt
function test_main(e)
PlayerDX = g_Entity[e]['x'] - g_PlayerPosX;
PlayerDY = g_Entity[e]['y'] - g_PlayerPosY;
PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;
PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ));
if PlayerDist < 80 then
if g_KeyPressE == 1 then
Prompt("This box is small and sturdy.");
end
end
end
ALSO, two questions:
1. Can I change the font type, size, colour etc within LUA/FPSCR?
2. Can I freeze the game whilst the prompt appears?
Thanks alot. (I have next to zero coding knowledge)
GPU: GTX 660, CPU: i7 3770 Intel 3.40ghz x4, PSU: 650 Watt, RAM: 8GB DDR3, OS: Win7 Ultimate 64-bit