• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

A globalevent script..

KnightmareZ

New Member
Joined
Feb 3, 2008
Messages
607
Reaction score
4
Location
Sweden/Ljungby
Hey - I got a script on my OT like this:

20:11 Fastest finger, first to type "!fastest :H:R:N:Q:p:V:G:L:O:T:" without the colons wins!
20:12 Winner! Babalash'fighter was the first to type it.

But I want that the winner get a reward of 10k gold..

Here is the script:
Code:
local letters = {}
for i = 1, 26 do
   letters[i] = string.char(i+64)
end
function onThink(interval, lastExecution)
    local randomstring = ""
    local presentstring = ""
    for i = 1, 10 do
        local rand = math.random(1, 26)
        randomstring = randomstring..letters[rand]
        presentstring = presentstring..":"..letters[rand]
    end
    presentstring = presentstring..":"
    setGlobalStorageString(1337, randomstring)
    setGlobalStorageValue(1337, 1)
    doBroadcastMessage('Fastest finger, first to type "!fastest '..presentstring..'" without the colons wins!', MESSAGE_EVENT_ORANGE)
    return TRUE
end


ty, and ofc rep++
 
that's the fasterfinger script from otfans, isnt it
post the talkaction script, there the prize can be modifiedd
 
talkaction script:

Code:
function onSay(cid, words, param, channel)
    local text = "Wait for a new round to start."
    if getGlobalStorageValue(1337) == 1 then
        text = "Incorrect, try again!"
        if param == getGlobalStorageString(1337) then
            text = "Congratulations! You are the fastest typer for this round."
            setGlobalStorageValue(1337, 0)
            doBroadcastMessage('Winner! '..getCreatureName(cid)..' was the first to type it.' , MESSAGE_EVENT_ORANGE)
        end
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
    return TRUE
end
 
Code:
function onSay(cid, words, param, channel)
    local text = "Wait for a new round to start."
    if getGlobalStorageValue(1337) == 1 then
        text = "Incorrect, try again!"
        if param == getGlobalStorageString(1337) then
            text = "Congratulations! You are the fastest typer for this round."
            setGlobalStorageValue(1337, 0)
            doPlayerAddItem(cid,2160,10)
            doBroadcastMessage('Winner! '..getCreatureName(cid)..' was the first to type it.' , MESSAGE_EVENT_ORANGE)
        end
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
    return TRUE
end
Not tested, but try :thumbup:
 
Back
Top