papam77 Posted June 21, 2013 Posted June 21, 2013 function lobby(system, player) -- Effects local bg = playSound("sound/sea.mp3", true) setSoundVolume(bg, 1.0) -- Design local background = { ["lobby"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/lobbyBG.png", true, arenas), ["arenas"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/arenas.png", true, dm, dd, trial), } -- Closed local closedArenas = { } -- local guiTable local guiTable = { ["dm"]= guiCreateStaticImage(0.157, 0.19, 0.17, 0.305, "images/areny/dm.png", true, arenas, lobby), ["dd"]= guiCreateStaticImage(0.331, 0.19, 0.17, 0.305, "images/areny/dd.png", true, arenas, lobby), ["trial"]= guiCreateStaticImage(0.506, 0.19, 0.17, 0.305, "images/areny/trials.png", true, arenas, lobby) } guiSetAlpha ( guiTable["dm"], 0.75 ) guiSetAlpha ( guiTable["dd"], 0.75 ) guiSetAlpha ( guiTable["trial"], 0.75 ) addEventHandler( "onClientMouseEnter", root, function(aX, aY) for key,gui in pairs (guiTable) do if gui == source then guiSetAlpha ( source, 1 ) playSound("sound/btn.mp3") return end end end ) addEventHandler( "onClientMouseLeave", root, function(aX, aY) for key,gui in pairs (guiTable) do if gui == source then guiSetAlpha ( source, 0.75 ) return end end end ) -- Texts local caa = guiCreateLabel(0.00, 0.00, 1.00, 0.14, "Choose an Arena", true) guiSetFont ( caa,guiCreateFont("fonts/font.ttf", 40 ) ) guiLabelSetHorizontalAlign(caa, "center", false) guiLabelSetVerticalAlign(caa, "center") -- local players = guiCreateLabel(0.00, 0.85, 1.00, 0.14, "Players: ".. tostring( #getElementsByType( "player" ) ), true) guiSetFont ( players,guiCreateFont("fonts/font.ttf", 40 ) ) guiLabelSetHorizontalAlign(players, "center", false) guiLabelSetVerticalAlign(players, "center") end addCommandHandler ("system", lobby) With error: http://www.upload.ee/image/3397967/witherror.png With no error: http://www.upload.ee/image/3397969/withouterror.png And where's the problem? When i click to background icon move under image. Why?
xXMADEXx Posted June 21, 2013 Posted June 21, 2013 This script haves not function for what your trying to do..
bandi94 Posted June 21, 2013 Posted June 21, 2013 function lobby(system, player) -- Effects local bg = playSound("sound/sea.mp3", true) setSoundVolume(bg, 1.0) -- Design local background = { ["lobby"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/lobbyBG.png", true, arenas), ["arenas"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/arenas.png", true, dm, dd, trial), } guiSetEnabled(background["lobby"],false) guiSetEnabled(background["arenas"],false) -- Closed local closedArenas = { } -- local guiTable local guiTable = { ["dm"]= guiCreateStaticImage(0.157, 0.19, 0.17, 0.305, "images/areny/dm.png", true, arenas, lobby), ["dd"]= guiCreateStaticImage(0.331, 0.19, 0.17, 0.305, "images/areny/dd.png", true, arenas, lobby), ["trial"]= guiCreateStaticImage(0.506, 0.19, 0.17, 0.305, "images/areny/trials.png", true, arenas, lobby) } guiSetAlpha ( guiTable["dm"], 0.75 ) guiSetAlpha ( guiTable["dd"], 0.75 ) guiSetAlpha ( guiTable["trial"], 0.75 ) addEventHandler( "onClientMouseEnter", root, function(aX, aY) for key,gui in pairs (guiTable) do if gui == source then guiSetAlpha ( source, 1 ) playSound("sound/btn.mp3") return end end end ) addEventHandler( "onClientMouseLeave", root, function(aX, aY) for key,gui in pairs (guiTable) do if gui == source then guiSetAlpha ( source, 0.75 ) return end end end ) -- Texts local caa = guiCreateLabel(0.00, 0.00, 1.00, 0.14, "Choose an Arena", true) guiSetFont ( caa,guiCreateFont("fonts/font.ttf", 40 ) ) guiLabelSetHorizontalAlign(caa, "center", false) guiLabelSetVerticalAlign(caa, "center") -- local players = guiCreateLabel(0.00, 0.85, 1.00, 0.14, "Players: ".. tostring( #getElementsByType( "player" ) ), true) guiSetFont ( players,guiCreateFont("fonts/font.ttf", 40 ) ) guiLabelSetHorizontalAlign(players, "center", false) guiLabelSetVerticalAlign(players, "center") end addCommandHandler ("system", lobby)
xXMADEXx Posted June 21, 2013 Posted June 21, 2013 Oh, lol, i fail! @_@ I forgot to see the rest of your script
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now