you have erroneous "else" in each section your calling an if statement then instantly telling it "else" with nothing inbetween
I think this should fix it, can't check it at work though.
function introspeak_init(e)
LoadImages("Master of the Astral",0)
IntroCounter = 0
end
function introspeak_main(e)
if IntroCounter > 0 then
SetImagePosition(50,50)
ShowImage(0)
FreezePlayer()
Prompt ("Press E to Continue" )
if g_KeyPressE == 1 then
IntroCounter = 1
HideImage(0)
end
end
else
if IntroCounter > 1 then
SetImagePosition(50,50)
ShowImage(1)
Prompt ("Press E to Continue" )
if g_KeyPressE == 1 then
IntroCounter = 2
UnFreezePlayer()
HideImage(1)
end
end
end
Here's a script that smallg wrote to do this some time ago, it uses images instead of sprites, but maybe it can help you work it out:
notes.lua
--smallg
--script to read a note/paper found in game
--image must be in folder "scriptbank\images\notes" & named "000.png" / "001.png" / "002.png" etc (change notes to whatever folder you want to use)
--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 = 3
local pressed = 0
local reading = {}
function notes_init(e)
LoadImages("notes",0) -- \\\\\\\\\\ change notes to folder required //////////
reading[e] = 0
end
function notes_main(e)
if flag_XXX_finished == 1 then -- \\\\\\\\\\ change XXX to flag required //////////
if GetPlayerDistance(e) <= use_range then
if reading[e] == 0 then
Prompt("Read Notes? Press E")
if GetInKey() == use_key and pressed == 0 then
Hide(e)
pressed = 1
reading[e] = 1
LoadImages("notes",0) -- \\\\\\\\\\ change notes to folder required //////////
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
flag_XXX_finished = 1 -- \\\\\\\\\\ change XXX to flag required //////////
end
end
function notes_exit(e)
end
end
i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.