• 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!

Little error should be a problem.. Easy rep

rcb chief

New Member
Joined
Dec 23, 2008
Messages
53
Reaction score
0
I made this script so that when i say a talkaction a teleport appear and after 2 min it deisappearss.. also it should execute a raid..

problems are
-raid doesnt execute
-teleport doesnt disappear
(raid does work i tested it like this: /raid monsterarena ... raid started)

Script
local minutes = 2 -- how many minutes you want before it removes the portal
local tp = {x=79, y=67, z=7} -- the place where the portal will appear
local tpto = {x=26, y=55, z=7} -- the pos of where the portal will lead you
local message = 'The Monster Arena Event has started, go to the teleport in the depot.. It will disappear in two minutes, dont worry you dont die in this event.' -- the message that will appear once activated.
local removemessage = 'The Monster Arena portal has been removed.' -- the message that will appear once tp is removed.


function onSay(cid, words, param)
doCreateTeleport(1387, tpto, tp)
doBroadcastMessage(message)
executeRaid(monsterarena)
return addEvent(onRemove, minutes*60*1000)
end

function onRemove()
local it = getTileItemById(tp, 1387)
if it > 0 then
doRemoveItem(it)
doBroadcastMessage(removemessage)
return true
end
end
 
LUA:
local minutes = 2
local tp = {x = 79, y = 67, z = 7}
local tpto = {x = 26, y = 55, z = 7}
local message = 'The Monster Arena Event has started, go to the teleport in the depot.. It will disappear in two minutes, dont worry you dont die in this event.'
local removemessage = 'The Monster Arena portal has been removed.'

function onRemove()
    local it = getTileItemById(tp, 1387)
    if it.uid > 0 then
        doRemoveItem(it.uid)
        doBroadcastMessage(removemessage)
    end
end 

function onSay(cid, words, param)
    doCreateTeleport(1387, tpto, tp)
    doBroadcastMessage(message)
    executeRaid("monsterarena")
    return addEvent(onRemove, minutes * 60 * 1000)
end
 
Try this! it's the one that naruhto made but i only changed it.uid to it.itemid:
LUA:
local minutes =  2
local tp = {x = 79, y = 67, z = 7}
local tpto = {x = 26, y = 55, z = 7}
local message = 'The Monster Arena Event has started, go to the teleport in the depot.. It will disappear in two minutes, dont worry you dont die in this event.'
local removemessage = 'The Monster Arena portal has been removed.'

function onRemove()
    local it = getTileItemById(tp, 1387)
    if it.itemid > 0 then
        doRemoveItem(it.uid)
        doBroadcastMessage(removemessage)
    end
end

function onSay(cid, words, param)
    doCreateTeleport(1387, tpto, tp)
    doBroadcastMessage(message)
    executeRaid("monsterarena")
    return addEvent(onRemove, minutes * 60 * 1000)
end
 
I don't know if it will work, but here it is:
LUA:
local minutes =   2
local tp2 = {x = 79, y = 67, z = 7, stackpos = 1}
local tp = {x = 79, y = 67, z = 7}
local tpto = {x = 26, y = 55, z = 7}
local message = 'The Monster Arena Event has started, go to the teleport in the depot.. It will disappear in two minutes, dont worry you dont die in this event.'
local removemessage = 'The Monster Arena portal has been removed.'

function onRemove()
    local it = getThingFromPos(tp)
    if it.itemid > 0 then
        doRemoveItem(it.uid)
        doBroadcastMessage(removemessage)
    end
end

function onSay(cid, words, param)
    doCreateTeleport(1387, tpto, tp)
    doBroadcastMessage(message)
    executeRaid("monsterarena")
    return addEvent(onRemove, minutes * 60 * 1000)
end
if 'tp' does not work then change it to 'tp2' where it
says " local it = getThingFromPos(tp) "
 
Last edited:
well basically because when you look for the function 'doRemoveItem(uid)' the uid is what what is asking for to be placed in it. now retry the script
again and see, i edited the script that's on top of you. and try with both 'tp'
 
didnt work.. :/
have you run out of ideas?
is this even possible ?


hmm.. can it be created with a uid and then simply remove the item with that uid?
 
try this: it seems like it's not doing 'addEvent' because if it did
and there was a problem with the script it would at least show an
error, so here:
LUA:
local minutes =   2
local tp2 = {x = 79, y = 67, z = 7, stackpos = 1}
local tp = {x = 79, y = 67, z = 7}
local tpto = {x = 26, y = 55, z = 7}
local message = 'The Monster Arena Event has started, go to the teleport in the depot.. It will disappear in two minutes, dont worry you dont die in this event.'
local removemessage = 'The Monster Arena portal has been removed.'

function onRemove()
    local it = getThingFromPos(tp)
    if it.itemid > 0 then
        doRemoveItem(it.uid)
        doBroadcastMessage(removemessage)
    end
end

function onSay(cid, words, param)
    doCreateTeleport(1387, tpto, tp)
    doBroadcastMessage(message)
    executeRaid("monsterarena")
	addEvent(onRemove, minutes * 60 * 1000)
return true
end
 
the only thing i can ask is what kind of server are you using???
Edit:
I'm going to sleep but if this isn't resolved by tomorrow I'll try my best to help you.
 
Last edited:
try

Code:
function onSay(cid,words,param)
local s = 1000
	doCreateTeleport(1387,tpto,tp)
	doBroadcastMessage('The Monster Arena Event has been created, it will dissapear in 2 minutes. You won\'t die in this event.')
	executeRaid('monsterarena')
	addEvent(removeTP,2*60*1000)
	return true
end

function removeTP(item,pos)
local v = {x=79,y=67,z=7,stackpos=253}
local r = getTileItemById(v,1387).uid
	if r > 0 then
		doRemoveItem(r)
		doBroadcastMessage('The Monster Arena portal has been removed.')
	end
end
 
Back
Top