Jump to content

Help


-.Paradox.-

Recommended Posts

Posted

Hello, can somebody fix to me this? i want it to shoot every player in the game random texts every minute, thanks for help

messages = {"test1","test2","test3","test4"}  
setTimer(function() 
    local randomMsg = math.random(1,#messages) 
        textDisplay = textCreateDisplay ( ) 
        textItem = textCreateTextItem ( messages, 0.5, 0.5, 2, 255, 255, 255, 255, 3, "center", "center" ) 
        textDisplayAddText ( textDisplay, textItem ) 
        for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do 
            textDisplayAddObserver ( textDisplay, thePlayer ) 
        end 
end 
,60000,1) 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Try this:

messages = {"test1","test2","test3","test4"} 
textDisplay = textCreateDisplay() 
textItem = textCreateTextItem(messages[math.random(#messages)], 0.5, 0.5, 2, 255, 255, 255, 255, 3, "center", "center") 
textDisplayAddText(textDisplay, textItem) 
  
setTimer(function() 
    textItemSetText(textItem, messages[math.random(#messages)]) 
    for _, thePlayer in ipairs(getElementsByType("player")) do 
        if not textDisplayIsObserver(textDisplay, thePlayer) then 
            textDisplayAddObserver(textDisplay, thePlayer) 
        end 
    end 
end, 60000, 0) 

CiTLh.png
Posted

Thanks but it don't disappear, what's the problem?It suppose to disappear after 5seconds

Edit: ah yeah sorry i forgot to tell you about that

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
messages = {"test1","test2","test3","test4"} 
textDisplay = textCreateDisplay() 
textItem = textCreateTextItem(messages[math.random(#messages)], 0.5, 0.5, 2, 255, 255, 255, 255, 3, "center", "center") 
textDisplayAddText(textDisplay, textItem) 
  
setTimer(function() 
    textItemSetText(textItem, messages[math.random(#messages)]) 
    for _, thePlayer in ipairs(getElementsByType("player")) do 
        if not textDisplayIsObserver(textDisplay, thePlayer) then 
            textDisplayAddObserver(textDisplay, thePlayer) 
        end 
    end 
end, 60000, 0) 
  
setTimer( 
function() 
destroyElement(textDisplay) 
destroyElement(textDisplay) 
 end 
, 5000, 1) 

Can you fix it please?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
messages = {"test1","test2","test3","test4"} 
textDisplay = textCreateDisplay() 
textItem = textCreateTextItem(messages[math.random(#messages)], 0.5, 0.5, 2, 255, 255, 255, 255, 3, "center", "center") 
textDisplayAddText(textDisplay, textItem) 
  
setTimer(function() 
    textItemSetText(textItem, messages[math.random(#messages)]) 
    for _, thePlayer in ipairs(getElementsByType("player")) do 
        textDisplayAddObserver(textDisplay, thePlayer) 
    end 
    setTimer(function() 
        for _, thePlayer in ipairs(getElementsByType("player")) do 
            if textDisplayIsObserver(textDisplay, thePlayer) then 
                textDisplayRemoveObserver(textDisplay, thePlayer) 
            end 
        end 
    end, 5000, 1) 
end, 60000, 0) 

CiTLh.png
Posted

Thanks man

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...