darkmu
Well-Known Member
ATTENTION:
READ ALL THE TOPIC [click here for a ba dum tss]
NO PERMISSIONS FOR USING THIS SCRIPT.
This script is hard to explain, so please test it to see how it works
Explaining:
When you use the item, it creates a "pet". He is made by effects, and move randomly. If there's any item in his way, the item is removed, and if there's a barrier, it moves for anyway except to the barrier's (doesn't matter how many barriers there are)
- You need to stuck him in somewhere. He can only walk in flat ground! So, any unmovable item (excepting ground) is classified as a barrier.
Example from a good place: click
Barriers in red (walls are barriers too, obviously)
Script:
[data/actions/scripts/clean.lua]
Please note the words are in portuguese (because I'm brazilian, so edit the portuguese words (e.g: ctrl + f: saudacoes)
Tag:
[data/actions/actions.xml]
Thank you guys.
READ ALL THE TOPIC [click here for a ba dum tss]
NO PERMISSIONS FOR USING THIS SCRIPT.
This script is hard to explain, so please test it to see how it works
Explaining:
When you use the item, it creates a "pet". He is made by effects, and move randomly. If there's any item in his way, the item is removed, and if there's a barrier, it moves for anyway except to the barrier's (doesn't matter how many barriers there are)
- You need to stuck him in somewhere. He can only walk in flat ground! So, any unmovable item (excepting ground) is classified as a barrier.
Example from a good place: click
Barriers in red (walls are barriers too, obviously)
Script:
[data/actions/scripts/clean.lua]
Code:
-- script by Eitor Laba
-- bot cleaner v1.0
local c = {x=0,y=0,z=0}
function onUse(cid, item, frompos, item2, topos)
function newEffect()
local random = math.random(1,4)
local effects = {47}
local delay = 0.8
local msgs = {"Oops!","Bloqueado","Epa!"}
if random == 1 then
c.x = c.x + 1
elseif random == 2 then
c.x = c.x - 1
elseif random == 3 then
c.y = c.y + 1
elseif random == 4 then
c.y = c.y - 1
end
if math.random(1,8) == 5 then
local saudacoes = {"Tudo bom?","Limpando!","Olá!",":D","Passando!"}
doSendAnimatedText(c,saudacoes[math.random(0,#saudacoes)],160)
end
if getThingFromPos(c).itemid > 0 then
if isItemMovable(getThingFromPos(c).itemid) then
c.stackpos = 253
if not isCreature(getThingFromPos(c).uid) then
doSendAnimatedText(c,"Limpo!",TEXTCOLOR_YELLOW)
doCleanTile(c)
c.stackpos = 1
else
doSendAnimatedText(c,"Licença!",160)
c.stackpos = 1
end
else
if random == 1 then
c.x = c.x - 1
elseif random == 2 then
c.x = c.x + 1
elseif random == 3 then
c.y = c.y - 1
elseif random == 4 then
c.y = c.y + 1
end
doSendAnimatedText(c,msgs[math.random(0,#msgs)],TEXTCOLOR_YELLOW)
end
end
doSendMagicEffect(c,effects[math.random(1,#effects)])
addEvent(newEffect,delay * 1000)
end
c = getPlayerPosition(cid)
c.stackpos = 1
newEffect()
return TRUE
end
Tag:
[data/actions/actions.xml]
Code:
<action uniqueid="xxx" script="clean.lua"/>
Thank you guys.
Attachments
-
25s4uhf.jpg17.8 KB · Views: 91 · VirusTotal