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

Inverted walk when using object

sibbe

New Member
Joined
Oct 28, 2007
Messages
51
Reaction score
0
Is it possible to make a character walk left when he presses right, and walk up when he presses down when he has used an object?

This should only last for about 30 seconds.
 
Lol, i did not think about it. Sure, you can do it, haha. But only through source, you have to edit walking function.
 
idk xd
btw there is already a kagemane script, I tested it some months ago :] was funny controlling another player
my old 0.2's edited:
Lua:
local function move(cid, target, playerpos, targetpos, times)
    if playerpos ~= getCreaturePosition(cid) then
        if playerpos.z == getCreaturePosition(cid).z then
            local newtargetpos = getCreaturePosition(target)
            local newpos = getCreaturePosition(cid)
            local x = newpos.x-playerpos.x
            local y = newpos.y-playerpos.y
            newtargetpos = getCreaturePosition(target)
            newtargetpos.x = newtargetpos.x+x
            newtargetpos.y = newtargetpos.y+y
            local playerpos = getCreaturePosition(cid)
            local targetpos = getCreaturePosition(target)
            if isSightClear(targetpos, newtargetpos, 1) == TRUE then
                doTeleportThing(target, newtargetpos, true)
            end
        end
    end
    local playerpos = getCreaturePosition(cid)
    local targetpos = getCreaturePosition(target)
    local times = times+1
    if times < 10 then
        addEvent(move, 1000, cid, target, playerpos, targetpos, times)
    else
        mayNotMove(target, 0)
    end
end

function onCastSpell(cid, var)
    local target = getCreatureTarget(cid) 
    if isPlayer(target) == TRUE then
        mayNotMove(target, 1)
        local playerpos = getCreaturePosition(cid)
        local targetpos = getCreaturePosition(target)
        doSendDistanceShoot(playerpos, targetpos, 31)
        local times = 1
        addEvent(move, 1000, cid, target, playerpos, targetpos, times)
    end
end
 
haha If I get time today and it works, I'll release a 0.3 edition today
:s letsee how can I void it from piercing walls
 
then the problem is here with this useless function
Lua:
if isSightClear(targetpos, newtargetpos, 1) == TRUE then
                doTeleportThing(target, newtargetpos, true)
            end
 
Code:
if(doTileQueryAdd(target, newtargetpos) == RETURNVALUE_NOERROR) then
	doTeleportThing(target, newtargetpos, true)
end
??
 
:) ok this one is working for 0.3.5pl1

Lua:
local function move(cid, target, playerpos, targetpos, times)
    if playerdir ~= getCreatureLookDirection(cid) then
        doCreatureSetLookDirection(target, getCreatureLookDirection(cid))
    end

    if playerpos ~= getCreaturePosition(cid) then
        if playerpos.z == getCreaturePosition(cid).z then
            local newtargetpos = getCreaturePosition(cid)
            local x = newtargetpos.x-playerpos.x
            local y = newtargetpos.y-playerpos.y
            local z = newtargetpos.z-playerpos.z
            newtargetpos = getCreaturePosition(target)
            newtargetpos.x = newtargetpos.x+x
            newtargetpos.y = newtargetpos.y+y
            newtargetpos.z = newtargetpos.z+z    
            if queryTileAddThing(target, newtargetpos) == RETURNVALUE_NOERROR and getCreaturePosition(cid).z == getCreaturePosition(target).z then
                doMoveCreature(target, getCreatureLookDirection(cid))
            end
        end
    end
    local playerpos = getCreaturePosition(cid)
    local targetpos = getCreaturePosition(target)
    local times = times+1
    if times < 10 then
        addEvent(move, 1000, cid, target, playerpos, targetpos, times)
        doSendMagicEffect(getCreaturePosition(target), CONST_ME_SMALLCLOUDS)
    else
        doCreatureSetNoMove(target, 0)
        doSendDistanceShoot(targetpos, playerpos, 31)
        doSendAnimatedText(targetpos, "FREE!", math.random(1,255))
        doChangeSpeed(target, getCreatureBaseSpeed(target))
        doPlayerSendCancel(target, "You've been freed from "..getPlayerName(cid).."'s Shadow Possesion Jutsu.")
        setPlayerStorageValue(target, 14755, -1)
    end
end

function onCastSpell(cid, var)
    local target = getCreatureTarget(cid) 
    if isPlayer(target) == TRUE then
        if getPlayerStorageValue(target, 14755) == -1 then
            doCreatureSetNoMove(target, 1)
            doChangeSpeed(target, getCreatureSpeed(cid))
            doPlayerSendCancel(target, "You have been possessed by "..getPlayerName(cid)..".")
            doSendAnimatedText(getCreaturePosition(target), "POSSESSED!", math.random(1,255))
            local playerpos,playerdir,targetpos = getCreaturePosition(cid), getPlayerLookDir(cid), getCreaturePosition(target)
            doSendDistanceShoot(playerpos, targetpos, 31)
            local times = 1
            addEvent(move, 1000, cid, target, playerpos, targetpos, times)
            setPlayerStorageValue(target, 14755, 1)
        else
            doPlayerSendCancel(cid, "Your shadow possession jutsu isn't worn out yet.")
        end
    end
end
 
Last edited:
Back
Top