Jump to content

Auto Messge


John_Scott

Recommended Posts

Hello John!

The current script will only work on the server side:

local mRed = 255 
local mGreen = 255 
local mBlue = 255 
  
local theMessages = { 
    'Message 1', 
    'Message 2', 
    'Message 3', 
    'Message 4', 
    'Message 5', 
    'Message 6' 
} 
  
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
    setTimer(outputChatBox, 300000, 0, theMessages[math.random(#theMessages)], localPlayer, mRed, mGreen, mBlue, true) 
end ) 

If you want to use this client sided change line 16 to:

setTimer(outputChatBox, 300000, 0, theMessages[math.random(#theMessages)], mRed, mGreen, mBlue, true) 

Enjoy, please learn from it.

Link to comment
Hello John!

The current script will only work on the server side:

local mRed = 255 
local mGreen = 255 
local mBlue = 255 
  
local theMessages = { 
    'Message 1', 
    'Message 2', 
    'Message 3', 
    'Message 4', 
    'Message 5', 
    'Message 6' 
} 
  
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
    setTimer(outputChatBox, 300000, 0, theMessages[math.random(#theMessages)], localPlayer, mRed, mGreen, mBlue, true) 
end ) 

If you want to use this client sided change line 16 to:

setTimer(outputChatBox, 300000, 0, theMessages[math.random(#theMessages)], mRed, mGreen, mBlue, true) 

Enjoy, please learn from it.

Thank you very much!

Link to comment
Hello John!

The current script will only work on the server side:

local mRed = 255 
local mGreen = 255 
local mBlue = 255 
  
local theMessages = { 
    'Message 1', 
    'Message 2', 
    'Message 3', 
    'Message 4', 
    'Message 5', 
    'Message 6' 
} 
  
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
    setTimer(outputChatBox, 300000, 0, theMessages[math.random(#theMessages)], localPlayer, mRed, mGreen, mBlue, true) 
end ) 

If you want to use this client sided change line 16 to:

setTimer(outputChatBox, 300000, 0, theMessages[math.random(#theMessages)], mRed, mGreen, mBlue, true) 

Enjoy, please learn from it.

client-sided outputChatBox does not have a 'visibleTo' param, also there is no need for onClientResourceStart.

local mRed = 255 
local mGreen = 255 
local mBlue = 255 
  
local theMessages = { 
    'Message 1', 
    'Message 2', 
    'Message 3', 
    'Message 4', 
    'Message 5', 
    'Message 6' 
} 
  
setTimer ( outputChatBox, 1000 * 60 * 5, 0, theMessages [ math.random ( #theMessages ) ], mRed, mGreen, mBlue, true ) 

Link to comment
Hello John!

The current script will only work on the server side:

local mRed = 255 
local mGreen = 255 
local mBlue = 255 
  
local theMessages = { 
    'Message 1', 
    'Message 2', 
    'Message 3', 
    'Message 4', 
    'Message 5', 
    'Message 6' 
} 
  
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
    setTimer(outputChatBox, 300000, 0, theMessages[math.random(#theMessages)], localPlayer, mRed, mGreen, mBlue, true) 
end ) 

If you want to use this client sided change line 16 to:

setTimer(outputChatBox, 300000, 0, theMessages[math.random(#theMessages)], mRed, mGreen, mBlue, true) 

Enjoy, please learn from it.

client-sided outputChatBox does not have a 'visibleTo' param, also there is no need for onClientResourceStart.

local mRed = 255 
local mGreen = 255 
local mBlue = 255 
  
local theMessages = { 
    'Message 1', 
    'Message 2', 
    'Message 3', 
    'Message 4', 
    'Message 5', 
    'Message 6' 
} 
  
setTimer(outputChatBox, 1000 * 60 * 5, 0, theMessages[math.random(#theMessages)], mRed, mGreen, mBlue, true) 

Not working too, what start the function?

Link to comment
local mRed = 255 
local mGreen = 255 
local mBlue = 255 
  
local theMessages = { 
    'Message 1', 
    'Message 2', 
    'Message 3', 
    'Message 4', 
    'Message 5', 
    'Message 6' 
} 
      
setTimer ( outputChatBox, 1000 * 60 * 5, 0, theMessages [ math.random ( #theMessages ) ], root, mRed, mGreen, mBlue, true ) 

Link to comment
local mRed = 255 
local mGreen = 255 
local mBlue = 255 
  
local theMessages = { 
    'Message 1', 
    'Message 2', 
    'Message 3', 
    'Message 4', 
    'Message 5', 
    'Message 6' 
} 
      
setTimer(function() outputChatBox(theMessages[math.random(#theMessages)], root, mRed, mGreen, mBlue, true) end, 1000 * 60 * 5, 0) 

Link to comment

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...