function onSay(cid, words, param)
local party = getPartyMembers(getPlayerParty(cid))
for _,pid in ipairs(party) do
doPlayerSendChannelMessage(pid, "", getPlayerName(pid) .. " rolls " .. math.random(1,100), TALKTYPE_CHANNEL_W, CHANNEL_DEFAULT)
end
return true
end
<talkaction access="0" log="no" filter="word" words="!roll" script="roll.lua" />
LUA:function onSay(cid, words, param) local party = getPartyMembers(getPlayerParty(cid)) for _,pid in ipairs(party) do doPlayerSendChannelMessage(pid, "", getPlayerName(pid) .. " rolls " .. math.random(1,100), TALKTYPE_CHANNEL_W, CHANNEL_DEFAULT) end return true end
I didn't test this and I don't know the party functions so this will probably not work!
You still haven't even fully described what the script is supposed to do, someone even offered to help if you told them, but you just spammed bump. Also, this is the wrong section for requests
local cfg = {
randSize = 100,
exhaustStorage = 30000,
exhaustSeconds = 10
}
function onSay(cid, words, param, channel)
return
os.difftime(os.time(), getPlayerStorageValue(cid, cfg.exhaustStorage)) >= cfg.exhaustSeconds and
doCreatureSay(cid, "You got number ".. math.random(cfg.randSize) .."!", TALKTYPE_ORANGE_1) and
setPlayerStorageValue(cid, cfg.exhaustStorage, os.time())
or
doPlayerSendCancel(cid, "You can only use this command once every ".. cfg.exhaustSeconds .." seconds.")
end
<talkaction access="0" log="no" filter="word" words="!roll" script="roll.lua" />
LUA:function onSay(cid, words, param) local party = getPartyMembers(getPlayerParty(cid)) for _,pid in ipairs(party) do doPlayerSendChannelMessage(pid, "", getPlayerName(pid) .. " rolls " .. math.random(1,100), TALKTYPE_CHANNEL_W, CHANNEL_DEFAULT) end return true end
I didn't test this and I don't know the party functions so this will probably not work!
function onSay(cid, words, param)
local party = getPartyMembers(getPlayerParty(cid))
local randomvalue = math.random(1,100)
for _,pid in ipairs(party) do
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, getPlayerName(pid) .. " rolls " .. randomvalue .. ".")
end
return true
end
You still haven't even fully described what the script is supposed to do, someone even offered to help if you told them, but you just spammed bump. Also, this is the wrong section for requests
No, that's the point of the entire code .. it would break without return, try it ;]@up, you made a small mistake, remove "return".
Code:local cfg = { randSize = 100, exhaustStorage = 30000, exhaustSeconds = 10 } function onSay(cid, words, param, channel) return os.difftime(os.time(), getPlayerStorageValue(cid, cfg.exhaustStorage)) >= cfg.exhaustSeconds and doCreatureSay(cid, "You got number ".. math.random(cfg.randSize) .."!", TALKTYPE_ORANGE_1) and setPlayerStorageValue(cid, cfg.exhaustStorage, os.time()) or doPlayerSendCancel(cid, "You can only use this command once every ".. cfg.exhaustSeconds .." seconds.") end
Wrong, that will give different values for each member. Also, you are using the wrong function to send the rolling message.
Really? Why would you need to make a source edit for this?not possible without huge source edit.