Try the file attached (they're copies of my originals, in the folder structure i use, including the images), just open up the zip and drag the scriptbank folder into your gameguru\files folder, it will put everything where it needs to go.
Then in the editor, place a barrel, make it static = no, and always active = yes, and add difficulty_menu.lua (you will find it in scriptbank\dmenu)
You can see it working on the beginning of my video below:
Here's the code:
--sprite size
local bgbox_spr_sizex = 20
local bgbox_spr_sizey = 50
local bgbox2_spr_sizex = 100
local bgbox2_spr_sizey = 100
function difficulty_menu_init(e)
d_menu=0
cursor_im=LoadImage ( "scriptbank\\images\\dmenu\\cursor.png" )
bgbox_sprite = LoadImage("scriptbank\\images\\dmenu\\bgbox.png")
bgbox_icon = CreateSprite(bgbox_sprite)
SetSpriteSize (bgbox_icon,bgbox_spr_sizex,bgbox_spr_sizey)
SetSpriteDepth (bgbox_sprite, 100)
SetSpritePosition(bgbox_icon, 200, 200)
bgbox2_sprite = LoadImage("scriptbank\\images\\dmenu\\bgbox.png")
bgbox2_icon = CreateSprite(bgbox2_sprite)
SetSpriteSize (bgbox2_icon,bgbox2_spr_sizex,bgbox2_spr_sizey)
SetSpriteDepth (bgbox2_sprite, 50)
SetSpritePosition(bgbox2_icon, 200, 200)
end
function difficulty_menu_main(e)
PlayerDist = GetPlayerDistance(e)
--if PlayerDist < 1000 and d_menu==0 then
if d_menu==0 then
d_menu=1
cursor_sp=CreateSprite ( cursor_im )
FreezePlayer()
ActivateMouse()
end
if d_menu==1 then
TextCenterOnXColor(50,30,4,"Difficulty",200,0,0)
PasteSpritePosition(bgbox_icon,40,25)
PasteSpritePosition(bgbox2_icon,0,0)
SetSpritePosition ( cursor_sp , g_MouseX , g_MouseY )
TextCenterOnX(50,40,6,"Easy")
TextCenterOnX(50,50,6,"Normal")
TextCenterOnX(50,60,6,"Hard")
end
if g_MouseX>49 and g_MouseX<61 then
if g_MouseY>39 and g_MouseY<46 then
if g_MouseClick==1 and d_menu==1 then
DeleteSprite(cursor_sp)
UnFreezePlayer()
DeactivateMouse()
SetPlayerHealth(300)
SetPlayerLives(0)
PromptDuration("You have selected Easy Difficulty: 300 Health, 99 Lives",6000)
d_menu=2
g_player_hp_max = 300
end
end
end
if g_MouseX>49 and g_MouseX<61 then
if g_MouseY>49 and g_MouseY<56 then
if g_MouseClick==1 and d_menu==1 then
DeleteSprite(cursor_sp)
UnFreezePlayer()
DeactivateMouse()
SetPlayerHealth(200)
SetPlayerLives(3)
PromptDuration("You have selected Normal Difficulty: 200 Health, 3 Lives",6000)
d_menu=2
g_player_hp_max = 200
end
end
end
if g_MouseX>49 and g_MouseX<61 then
if g_MouseY>59 and g_MouseY<66 then
if g_MouseClick==1 and d_menu==1 then
DeleteSprite(cursor_sp)
UnFreezePlayer()
DeactivateMouse()
SetPlayerHealth(100)
SetPlayerLives(1)
PromptDuration("You have selected Hard Difficulty: 100 Health, 1 Life",6000)
d_menu=2
g_player_hp_max = 100
end
end
end
end
i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.