Jump to content

Hamilton

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by Hamilton

  1. Not working , I only get this message: Report all the bugs you find with /report. I do not get any of the other
  2. Why is this not working? Please help me. function MyTestTextFunction ( ) if ( not text01 ) then display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text01 = textCreateTextItem ( "Report all the bugs you find with /report.", 0.01, 0.20 ) -- create a text item text02 = textCreateTextItem ( "Some text", 0.01, 0.20 ) -- create a text item text03 = textCreateTextItem ( "Some text", 0.01, 0.20 ) -- create a text item textItemSetScale ( text01, 1.5) textItemSetScale ( text02, 1.5) textItemSetScale ( text03, 1.5) any = math.random(1,3) if (any == 1) then textDisplayAddText ( display, text01 ) -- Add the text item to the text display setTimer ( function ( ) textDestroyTextItem ( text01 ) text01 = nil end ,20000, 1 ) elseif (any == 2) then textDisplayAddText ( display, text02 ) -- Add the text item to the text display setTimer ( function ( ) textDestroyTextItem ( text02 ) text02 = nil end ,20000, 1 ) elseif (any == 3) then textDisplayAddText ( display, text03 ) -- Add the text item to the text display setTimer ( function ( ) textDestroyTextItem ( text03 ) text03 = nil end ,20000, 1 ) end end setTimer ( MyTestTextFunction, 15000, 0 ) addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction ) Error message: WARNING: Loading script failed: notice\notice.lua:49: 'end' expected (to close 'function' at line 1) near ''
  3. Thank you Castillo! Just 1 question, how do I make many different messages show? I've got 1 message now, is it possible to make like a table where I can add messages and then when 1 message have been sent it will send the next one?
  4. It doesn't. It just creates it 1 time then it dissapears and it wont create it again.
  5. ]Working But now I got 1 more problem... I want the text to remake itself after a certain amount of time. I thought it would work the way I did it but It wont Here is the code, whats wrong?: function MyTestTextFunction ( ) display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text = textCreateTextItem ( "Report all the bugs you find with /report.", 0.01, 0.20 ) -- create a text item textItemSetScale ( text, 1.5) textDisplayAddText ( display, text ) -- Add the text item to the text display setTimer ( textCreateTextItem, 15000, 0, text ) setTimer ( textDestroyTextItem, 20000, 1, text ) end addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction )
  6. Good, that worked but now I got another problem I want it to destroy after 5 seconds Here is the script: function MyTestTextFunction ( ) display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text = textCreateTextItem ( "Hello World", 0.5, 0.5 ) -- create a text item textItemSetScale ( text, 2.0) textDisplayAddText ( display, text ) -- Add the text item to the text display textDestroyTextItem ( text ) setTimer ( textDestroyTextItem, 5000, 1 ) end addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction )
  7. Still not working I want it to create a text in the screen for all the players when the resource starts. Here is the Script file code and the Meta code: Meta.xml: "Hamilton" type="script" name="Notice" /> notice.lua: function MyTestTextFunction ( ) display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) -- create a text item textDisplayAddText ( display, text ) -- Add the text item to the text display end addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction )
  8. I want this to show for everyplayer when the resource starts but it wont work Help is apricciated! Here is the code: function MyTestTextFunction () display = textCreateDisplay () -- create a new display, store the reference in a variable called display textDisplayAddObserver ( display, thePlayer ) -- add an observer to it text = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) -- create a text item textDisplayAddText ( display, text ) -- Add the text item to the text display end addEventHandler("onResourceStart", getRootElement(), MyTestTextFunction)
  9. Hamilton

    Help pls!

    THANK YOU SOOO MUCH!!!
  10. Hamilton

    Economy V1.0

    What do you mean?
  11. Hamilton

    Help pls!

    I want a resource that starts a random race map when someone wins on the current map. Like VoteManager but without the vote. Could you please give me some help?
  12. I don't get it. Could you fix the code for me and explain what you did?
  13. It wont show anything. I do not get any debug errors either. function showTextDisplay ( player ) local serverDisplay = textCreateDisplay() -- create a text display textDisplayAddObserver ( serverDisplay, player ) -- make it visible to a player local serverText = textCreateTextItem ( "Hello world!", 0.01, 0.3 ) -- create a text item for the display textDisplayAddText ( serverDisplay, serverText ) -- add it to the display so it is displayed end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), showTextDisplay )
×
×
  • Create New...