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

Create monster item when onpos

Swiff

Member
Joined
Apr 6, 2009
Messages
366
Reaction score
12
Location
Sweden
So I had an idea, but I had to make some restrictions to make use of it. I can't get it to work, I've tried alot, but I guess it's because I don't really know what I am doing :p

Lua:
function onUse(cid, item, frompos, item2, itemEx, topos)
player1pos = getCreaturePosition(cid)
player1 = getThingfromPos(player1pos)
pos = getPlayerPosition(cid)
if
player1pos == {x=165, y=162, z=7} then


player1level = getPlayerLevel(player1.uid)
questlevel = 300
if player1level >= questlevel then
	doSummonCreature("Telarus",player1pos)
	doPlayerSendTextMessage(player1.uid,22,"Telarus!")
	doRemoveItem(item.uid, 1)
		else
			doPlayerSendTextMessage(player1.uid,22,"you need level 300.")
	return true
end
else
doPlayerSendTextMessage(player1.uid,22,"Not correct location.")
end
end

This will send the "not correct location" message, wherever I am. It won't summon when I'm on the position given - that's where I need some help..
 
Last edited:
You may use this (if the player that use the lever is the same that kills the monster...):

Lua:
local pos = {x=, y=, z=}
local summonPos = {x=, y=, z=}
local questLevel = 300
function onUse(cid, item, fromPos, itemEx, toPos)
if getCreaturePosition(cid) == pos then
if getPlayerLeve(cid) >= questlevel then
doSummonCreature("Telarus",player1pos)
doPlayerSendTextMessage(player1.uid,22,"Telarus!")
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You need to be level "..questlevel..".")
end
else
doPlayerSendCancel(cid, "Not correct location.")
end
return true
end
 
I'll try it out, thanks:) It's not a lever though, it's an item^^

- - - Updated - - -

It still says "not correct location". I edited it to:
Lua:
local pos = {x=165, y=162, z=7}
local summonPos = {x=164, y=161, z=7}
local questLevel = 300
function onUse(cid, item, fromPos, itemEx, toPos)
player1pos = getCreaturePosition(cid)
player1 = getThingfromPos(player1pos)
if getCreaturePosition(cid) == pos then
if getPlayerLeve(cid) >= questlevel then
doSummonCreature("Telarus",summonPos)
doPlayerSendTextMessage(player1.uid,22,"Telarus!")
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You need to be level "..questlevel..".")
end
else
doPlayerSendCancel(cid, "Not correct location.")
end
return true
end
and still no go :/ "not correct location"

And this didn't work either:
Lua:
local pos = {x=165, y=162, z=7}
local summonPos = {x=164, y=161, z=7}
local questLevel = 300
function onUse(cid, item, fromPos, itemEx, toPos)
if getCreaturePosition(cid) == pos then
if getPlayerLeve(cid) >= questlevel then
doSummonCreature("Telarus",summonPos)
doPlayerSendTextMessage(player1.uid,22,"Telarus!")
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You need to be level "..questlevel..".")
end
else
doPlayerSendCancel(cid, "Not correct location.")
end
return true
end
 
Last edited:
Try this:
Lua:
local pos = {x=165, y=162, z=7, stackpos=253}
local summonPos = {x=164, y=161, z=7}
local questLevel = 300
function onUse(cid, item, fromPos, itemEx, toPos)
if getCreaturePosition(cid) == pos then
if getPlayerLeve(cid) >= questlevel then
doSummonCreature("Telarus",summonPos)
doPlayerSendTextMessage(player1.uid,22,"Telarus!")
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You need to be level "..questlevel..".")
end
else
doPlayerSendCancel(cid, "Not correct location.")
end
return true
end

And this:
Lua:
local pos = {x=165, y=162, z=7}
local summonPos = {x=164, y=161, z=7}
local questLevel = 300
function onUse(cid, item, fromPos, itemEx, toPos)
cPos = getCreaturePosition(cid)
if cPos.x == pos.x and cPos.y == pos.y and cPos.z == pos.z then
if getPlayerLevel(cid) >= questlevel then
doSummonCreature("Telarus",summonPos)
doPlayerSendTextMessage(player1.uid,22,"Telarus!")
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You need to be level "..questlevel..".")
end
else
doPlayerSendCancel(cid, "Not correct location.")
end
return true
end
 
Last edited:
Lua:
local pos = {x=165, y=162, z=7}
local summonPos = {x=164, y=161, z=7}
local questLevel = 300
function onUse(cid, item, fromPos, itemEx, toPos)
cPos = getCreaturePosition(cid)
if cPos.x == pos.x and cPos.y == pos.y and cPos.z == pos.z then
if getPlayerLevel(cid) >= questlevel then
doSummonCreature("Telarus",summonPos)
doPlayerSendTextMessage(player1.uid,22,"Telarus!")
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You need to be level "..questlevel..".")
end
else
doPlayerSendCancel(cid, "Not correct location.")
end
return true
end
 
The "L" is alredy there in my script, however I haven't tried correcting that in the previous scripts, just the last 2 you posted. I may try them again.
 
Tried all scripts with corrected "L" I edited and tried more. Can't get it to work, the last scripts gives the previously mentioned error..

Bump, anyone else?
 
Lua:
local pos = {x=165, y=162, z=7}
local summonPos = {x=164, y=161, z=7}
local questLevel = 300
local cPos = getCreaturePosition(cid)

function onUse(cid, item, fromPos, itemEx, toPos)
	if(cPos == pos) then
		if getPlayerLevel(cid) >= questlevel then
			doSummonCreature("Telarus", summonPos)
			doPlayerSendTextMessage(cid, 22, "Telarus!")
			doRemoveItem(item.uid, 1)
		else
			doPlayerSendCancel(cid, "You need to be level "..questlevel..".")
		end
	else
		doPlayerSendCancel(cid, "Not correct location.")
	end
return true
end
 

Similar threads

Back
Top