Jump to content

Exoogen

Members
  • Posts

    6
  • Joined

  • Last visited

Exoogen's Achievements

Vic

Vic (3/54)

0

Reputation

  1. oh, i understand now, Thank you again
  2. yes, it works fine and thanks. Can you explain me why that script isn't written like another normal script ? Usually in a script there are a function with the function name, istruction and an EventHandler. In this case the function and instructions are written together.. PS: Sorry for my very bad english, i'm italian
  3. I don't know why but doesn't work D: mrandom.lua : local messages = ["hey","hello","hi"] setTimer(function() outputChatBox(messages[math.random(1,#messages)]) end, 5000,0) meta.xml "Exoogen" description="kk" />
  4. Hi guys, how can i use math.random for make random messages in game? For exaple: every 3 minutes "PRESS F6 and open the SHOP PANEL" or "Press F4 ..." Help
  5. Salve a tutti, Vorrei creare uno shop armi in game, in modo da far si che quando l'utente prema F6 possa prendere l'arma selezionata dalla GridList premendo quindi dopo tasto "Ok". Ho creato soltanto la grafica della Gui ma non so come dare le armi. So che si deve usare la funzione "guiGridListGetSelectedItem", ma non so come utilizzarla -- **Definizioni Armi**-- mitragliette = {"Fucile a pompa", "Fucile a canne mozze", "Fucile da combattimento" } ------------ -- **Funzione Script**-- function shopArmi() finestra = guiCreateWindow ( 0, 0, 0.5, 0.3, "--*SHOP MITRAGLIETTE*--", true) -- La finestra principale guiSetAlpha(finestra, 0) --Setto la finestra in modo che non si veda allo start della resource tabGenerale = guiCreateTabPanel ( 0, 0.1, 1, 0.7, true, finestra ) -- Creo la tabella Principale (poi ne aggiungerò altre) tabMitra = guiCreateTab ("FUCILI", tabGenerale) -- Creo la tabella mitra button = guiCreateButton(0, 0.8, 0.1, 0.1, "Prendi", true, finestra) -- Creo un tasto grigliaListaArmi = guiCreateGridList (0, 0, 1, 1, true, tabMitra) -- Creo la griglia/lista guiGridListSetSelectionMode ( grigliaListaArmi, 2 ) -- La rendo selezionabile guiGridListAddColumn (grigliaListaArmi, "MITRAGLIETTE", 0.3) -- Aggiungo una colonna per la lista for controlloArmi, nomeArma in pairs (mitragliette) do --ho modificato copiando da internet questo pezzo di script, più o meno lo capiso ma me lo potete spiegare "all'italiana" e.e ? local row = guiGridListAddRow (grigliaListaArmi) -- guiGridListSetItemText (grigliaListaArmi, row, 1, nomeArma, false, false) -- end end addEventHandler( "onClientResourceStart", getResourceRootElement ( getThisResource( ) ), shopArmi ) ------------------------------------------------------------- -- **Caratteristiche finestra**-- guiWindowSetSizable (finestra, true) guiWindowSetMovable(finestra, true) showCursor(true) -------------------------------------------------------------- -- **Apertura/Chiusura Finestra**-- function openit() if (guiGetVisible (finestra) == false) then guiSetVisible(finestra, true) guiSetAlpha(finestra, 1) showCursor(true) elseif (guiGetVisible (finestra) == true) then guiSetVisible(finestra, false) -- guiSetAlpha(finestra, 0) showCursor(false) end end bindKey ("F6", "down", openit)
×
×
  • Create New...