thanks, fixed
moved the loadimages call inside the script so now it will make sure it's loading the correct image when called to display - you still need to rename the script and change the LoadImages() folder (it's now at line 29) if you want multiple notes
note1.lua
--smallg
--script to read a note/paper found in game
--image must be in folder "scriptbank\images\note1" & named "000.png" / "001.png" / "002.png" etc
--how far away from note it can be read
local use_range = 120
--key press to read note
local use_key = "e"
--maximum notes to display (use key will cycle through)
local max_page = 2
local pressed = 0
local reading = {}
function note1_init(e)
reading[e] = 0
end
function note1_main(e)
if GetPlayerDistance(e) <= use_range then
if reading[e] == 0 then
PromptLocal(e,"Read note? *" ..use_key.."*")
if GetInKey() == use_key and pressed == 0 then
Hide(e)
pressed = 1
reading[e] = 1
LoadImages("note1",0)
SetImageAlignment(0)
SetImagePosition(50,50)
ShowImage(0)
end
elseif reading[e] >= 1 then
if GetInKey() == use_key and pressed == 0 then
pressed = 1
HideImage(reading[e] - 1)
reading[e] = reading[e] + 1
if reading[e] > max_page then
reading[e] = 0
Show(e)
else
ShowImage(reading[e] - 1)
end
end
end
else
if reading[e] > 0 then
HideImage(reading[e] - 1)
reading[e] = 0
Show(e)
end
end
if pressed == 1 and GetInKey() == "" then
pressed = 0
end
end
function note1_exit(e)
end
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11