• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Player spawns raid using item on Actionid(item)

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
Hello so i want to request if player uses item on lets say water with has specific actionid Spawns Specific raid and removes player item with is in script :) and if playeer uses instantly other item on acttionid to spawn raid he get buffed message wait for this raid to begin or end and item doesnt get taked if so .
i use 0.4

Thanks in advance :)
 
Last edited:
Hello so i want to request if player uses item on lets say water with has specific actionid Spawns Specific raid and removes player item with is in script :) and if playeer uses instantly other item on acttionid to spawn raid he get buffed message wait for this raid to begin or end and item doesnt get taked if so .
i use 0.4

Thanks in advance :)

Very very easy script.


data/actions/actions.xml
Code:
<action itemid="11111" event="script" value="raid_item.lua"/>
data/actions/scripts/raid_item.lua -- Use item, spawn raid
Code:
local raid_name = "raid name"

function onUse(cid, item, fromPosition, itemEx, toPosition)

     if not executeRaid(raid_name) then
         return doPlayerSendTextMessage(cid, 22, "A raid is already in progress. Please try again later.")
     end

     doRemoveItem(item.uid, 1)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Raid '" .. raid_name .. "' has been started.")

     return true
end
data/actions/scripts/raid_item.lua -- Use item on tile that contains ActionID, spawn raid
Code:
local raid_name = "raid name"
local action_id = 45001

function onUse(cid, item, fromPosition, itemEx, toPosition)

     if itemEx.aid ~= action_id then
         return true
     end

     if not executeRaid(raid_name) then
         return doPlayerSendTextMessage(cid, 22, "A raid is already in progress. Please try again later.")
     end

     doRemoveItem(item.uid, 1)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Raid '" .. raid_name .. "' has been started.")

     return true
end
------------------------------------------
Some rev's get error's with this line.. just because of how ActionID is called, simply change it to the other one listed if you get error's.

Code:
if itemEx.aid ~= action_id then
if itemEx.actionid ~= action_id then
 
Last edited by a moderator:

Very very easy script.


data/actions/actions.xml
Code:
<action itemid="11111" event="script" value="raid_item.lua"/>
data/actions/scripts/raid_item.lua -- Use item, spawn raid
Code:
local raid_name = "raid name"

function onUse(cid, item, fromPosition, itemEx, toPosition)

     if not executeRaid(raid_name) then
         return doPlayerSendTextMessage(cid, 22, "A raid is already in progress. Please try again later.")
     end

     doRemoveItem(item.uid, 1)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Raid '" .. raid_name .. "' has been started.")

     return true
end
data/actions/scripts/raid_item.lua -- Use item on tile that contains ActionID, spawn raid
Code:
local raid_name = "raid name"
local action_id = 45001

function onUse(cid, item, fromPosition, itemEx, toPosition)

     if itemEx.aid ~= action_id then
         return true
     end

     if not executeRaid(raid_name) then
         return doPlayerSendTextMessage(cid, 22, "A raid is already in progress. Please try again later.")
     end

     doRemoveItem(item.uid, 1)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Raid '" .. raid_name .. "' has been started.")

     return true
end
------------------------------------------
Some rev's get error's with this line.. just because of how ActionID is called, simply change it to the other one listed if you get error's.

Code:
if itemEx.aid ~= action_id then
if itemEx.actionid ~= action_id then
Will test after i get home :)
 
Back
Top