local U = require "scriptbank\\utillib" local notesList = nil local function loadNotes() -- change details in list to match names of note image files and entity names (or just use the defaults!) -- add as many entries as you want to the list notesList = { note1 = { spr = CreateSprite( LoadImage("scriptbank\\images\\note1.png") ), xpos = 25, ypos = 25, size = 50 }, note2 = { spr = CreateSprite( LoadImage("scriptbank\\images\\note2.png") ), xpos = 25, ypos = 25, size = 50 } } end local function showNote( name ) local note = notesList[ name ] SetSpriteSize( note.spr, note.size, -1 ) SetSpritePosition( note.spr, note.xpos, note.ypos ) end local function hideNote( name ) local note = notesList[ name ] SetSpritePosition( note.spr, 200, 200 ) end local notes = {} local Epressed = false function note_sprite_init_name( e, name ) Include("utillib.lua") if notes[ e ] == nil then notes[ e ] = { name = name, showing = false } end if notesList == nil then loadNotes() -- hide all notes for k, _ in pairs( notesList ) do hideNote( k ) end end end function note_sprite_main(e) local note = notes[ e ] if note == nil then return end if U.PlayerLookingNear( e, 100, 20 )then if not note.showing then PromptLocal( e, "Press E to Read Note?" ) end if g_KeyPressE == 1 then if not Epressed then Epressed = true PlaySound( e, 0 ) if not note.showing then note.showing = true showNote( note.name ) else note.showing = false hideNote( note.name ) end end else Epressed = false end elseif note.showing then note.showing = false hideNote( note.name ) end end