Hi there I know 0 about scrips but I am looking
to give it a shot with what we have in the alpha
I have a light in my map and I have set the main script
to "light.lua" and the contents of said file is below
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Light Changes when aprochaed
function light_main(e)
lightrange = lr
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
lr = 0
if PlayerDist > 80 then
lr = 8000
end
end
from what I understand with the code that I have added it should enable or disable the light based on the distance that I am from it but its not working
any one able to help?
Bring It On