Hi, i have a script called fastfinger "Fastest finger, first to type "!fastest :Z:R:A:Y:L:T:W:M:B:K:" without the colons wins!" i wonder if its possible to make that the one who types first gets a price like 1cc
i dont know if it has something to do with this but heres the script
Talkactions fastfinger.lua
Globalevents fastfinger.lua
i dont know if it has something to do with this but heres the script
Talkactions fastfinger.lua
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:
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