Jump to content

[help] Text Command


Recommended Posts

My script does not work, I want to when a player by typing / teles appear on your screen in the center The message example:

/arena .

What did this wrong help me!

My lua:

function shout(player, cmd, ...) 
local accountname = getAccountName(getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ))  then 
for id, players in ipairs(getElementsByType("player")) do 
local message = table.concat({...}," ") 
local textDisplay = textCreateDisplay () 
local nombre = getPlayerName(player) 
myTextItem = textCreateTextItem ( "/drop /drop2 /drop3", 0.5, 0.5 ) 
textDisplayAddText ( textDisplay, textItem ) 
textDisplayAddObserver ( textDisplay, players ) 
setTimer ( textDestroyTextItem, 2500, 1, textItem ) 
setTimer ( textDestroyDisplay, 2500, 1, textDisplay ) 
end 
else 
outputChatBox("",player,255,255,255) 
    end 
end 
  
addCommandHandler("teles", shout) 

Link to comment

Try this :

function shout(player, cmd, msg) 
    local accountname = getAccountName(getPlayerAccount(player)) 
  if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ))  then 
    for id, players in ipairs(getElementsByType("player")) do 
        local message = tostring(msg) 
        local textDisplay = textCreateDisplay () 
        local nombre = getPlayerName(player) 
        textItem = textCreateTextItem ( message, 0.5, 0.5 ) 
        textDisplayAddText ( textDisplay, textItem ) 
        textDisplayAddObserver ( textDisplay, players ) 
        setTimer ( textDestroyTextItem, 2500, 1, textItem ) 
        setTimer ( textDestroyDisplay, 2500, 1, textDisplay ) 
    end 
else 
    outputChatBox("",player,255,255,255) 
    end 
end 
addCommandHandler("teles", shout) 
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...