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

Solved Need Scripts for free items ramdom temple!

Deus Meus

New Member
Joined
May 18, 2014
Messages
120
Reaction score
1
Hello otland look and found a npc that gives random items to the temple something like a rain items but this makes it a npc has a time is possible that I can pass the scripts that you see that it runs a npc you run the admin example
/ additem and exit ramdom items but do not leave every single interval that comes out every two seconds the following items
use tfs 0.3.6
 
served very good scripts but I am not scripter as I add the function effect as that goes in ahe picture is not output when running the rain
Code:
local fromPos = {x =144, y =45, z =7}
local toPos = {x =153, y =53, z =7}
local items = {{8306,1}, {2157,2}, {7735,1}, {8306,1}, {2184,1}, {9932,1}, {8306,1}, {9693,1}}
local maxItems = 14

function isWalkable(pos, creature, proj, pz)
if getTileThingByPos({x=pos.x,y=pos.y,z=pos.z,stackpos=0}).itemid == 0 then return false end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return true
end
end
end
end
return true
end

function checkPositions(n)
local pos = {x=math.random(fromPos.x,toPos.x), y=math.random(fromPos.y,toPos.y), z=math.random(fromPos.z,toPos.z)}
if isWalkable(pos, true, false, true) then
return pos
end
return (n < 50 and checkPositions(n+1) or false)
end

function onSay(cid, words, param)
doBroadcastMessage("Todos Al Templo Rain Items En el templo en 1 Minuto.", MESSAGE_EVENT_ADVANCE)
return addEvent(spawnItem, 10, 1)
end

function spawnItem(created)
if created >= maxItems then
return doBroadcastMessage("Rain Item Event ha Finalizado!", MESSAGE_EVENT_ADVANCE)
end
local itemPos, itemInf = checkPositions(1), math.random(#items)
doCreateItem(items[itemInf][1], items[itemInf][2], itemPos)
doSendMagicEffect(itemPos, CONST_ME_LOSEENERGY)
return addEvent(spawnItem, 5000, created+1)
end
 
doSendMagicEffect(itemPos, CONST_ME_LOSEENERGY)
change to
doSendMagicEffect(itemPos, 55)
or
doSendMagicEffect(itemPos, CONST_ME_TUTORIALARROW)
 
Back
Top