Jump to content

Ayuda con un Script


SupraS

Recommended Posts

Como podria hacer un Resource que de Armas aleatorias a los jugadores Que escriban Letras Esto es llamado "Reaction Test" Pero no encuentro el resource por eso Como ultimo recurso vengo a pedirselo a ustedes que todo lo hacen.

Ejemplo:

Reacciona > UxDaFtA < Para ganar el Arma : ID o nombre

Link to comment
  • Administrators

Esto es un script de matemáticas..Asi te orientas un poco..Solo le cambias un par de cosas y lo tienes listo.

  
timeToAnswer = 30 -- 30 seconds 
  
addCommandHandler ( "math",  
        function ( player ) 
                if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) ) then 
                        reward = math.random ( 2000, 5000 ) 
                        qn1 = math.random ( 10, 100 ) 
                        qn2 = math.random ( 10, 100 ) 
                        qn3 = math.random ( 10, 100 ) 
                        theQuestion = qn1 + qn2 - qn3 
                        answerTime = setTimer ( noAnswer, timeToAnswer * 1000, 1 ) 
                        outputChatBox ( "Matematicas: El primero que conteste " .. qn1 .. " + " .. qn2 .. " - " .. qn3 .. " ganara $" .. reward .. "(Por LocalChat)", root, 0, 255, 0 ) 
                else 
                        outputChatBox ( "No puedes't usar este comando", player, 255, 0, 0 ) 
                end 
        end 
) 
  
function noAnswer ( ) 
        outputChatBox ( "Matematicas: Nadie gano el premio, la respuesta es: " .. theQuestion, root, 0, 255, 0 ) 
        theQuestion = nil 
end 
  
addEventHandler ( "onPlayerChat", root, 
        function ( answer ) 
                if ( theQuestion and tonumber ( answer ) == theQuestion ) then 
                        theQuestion = nil 
                        outputChatBox ( "Matematicas: " .. getPlayerName ( source ) .. " #00FF00contesto " .. answer .. " y gano $" .. reward, root, 0, 255, 0, true ) 
                        givePlayerMoney ( source, reward ) 
                        if ( isTimer ( answerTime ) ) then 
                                killTimer ( answerTime ) 
                        end 
                end 
        end 
) 

Link to comment
  • Recently Browsing   0 members

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