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

MoveEvent Real Fut Ball

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
Real Fut Ball

Script1:
PHP:
function onStepIn(cid, item, pos)

dir = getPlayerLookDir(cid)


if dir == 0 then
doRemoveItem(item.uid,1)
pos.y = pos.y-1
doCreateItem(2109,1,pos)

elseif dir == 1 then
doRemoveItem(item.uid,1)
pos.x = pos.x+1
doCreateItem(2109,1,pos)

elseif dir == 2 then
doRemoveItem(item.uid,1)
pos.y = pos.y+1
doCreateItem(2109,1,pos)

elseif dir == 3 then
doRemoveItem(item.uid,1)
pos.x = pos.x-1
doCreateItem(2109,1,pos)


end
end

Script2:
PHP:
<movevent event="StepIn" itemid="2109" script="ball.lua" />

Have BUGs, please repair the errors!
 
Shorten:
PHP:
function onStepIn(cid, item, pos) 
	local dir = getPlayerLookDir(cid)
	local key = dir % 2 == 1 and "x" or "y"
	local newDir = isInArray({1, 2}, dir) and 1 or -1
	pos[key] = pos[key] + newDir
	doCreateItem(2109, 1, pos) 
end
 
Last edited:
Yes, I've already thought about it... But I don't wanna make it (right now), but maybe later if nobody does it before me :D

Edit:
PHP:
-- Script by ~Colandus~ and ~Pedro B.~
 
function onStepIn(cid, item, pos)
    local dir = getPlayerLookDir(cid) 
    local key = dir % 2 == 1 and "x" or "y"
    local newDir = isInArray({1, 2}, dir)==TRUE and 1 or -1
    pos[key] = pos[key] + newDir
 
    local ret = queryTileAddThing(item.uid, pos)
    if(ret == RETURNVALUE_NOERROR) then
        doTeleportThing(item.uid, pos)
    end
    return TRUE
end
 
Last edited:
You it is a good Scripter.
All good English are scripters, already the good Brazilians are mappers.
I translating use, but of the one to understand what I say, hehehe
I wait that somebody obtains to arrange the error of the wall.
 
I already did that, look at the script above, it has fixed the wallbug, but it was Pedro B (he's brazillian :D). from another forum who made that fix, I only made the script shorter :D
 
Back
Top