• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Request] Car System REP++ For help

Peacy

Member
Joined
Mar 20, 2008
Messages
488
Reaction score
10
Location
The Netherlands
Well I have a really cool idea, could somebody make a car system that you could use with the key's ASWD? so you don't have to say "car stop" or something. thanks for reading:)

Dno if it's posted in the right section, say if it's not.


Rep ++ If you could help me tnx!
 
Last edited:
erm correct me if I'm wrong but I think hotkey's are client sided and send information to the client when touched / used.. so in order to make ASWD as 'movement' keys you'd need to edit the Tibia client, unless you make your character say 'A'. 'S', 'D', 'W', then you could do it through LUA
 
WASD can be done through c++, seen that somewhere in OTland. However that was if you wanted to walk using WASD XD
 
erm correct me if I'm wrong but I think hotkey's are client sided and send information to the client when touched / used.. so in order to make ASWD as 'movement' keys you'd need to edit the Tibia client, unless you make your character say 'A'. 'S', 'D', 'W', then you could do it through LUA


It doesn't matter if I have to change client

Ty:)

~Sry for dubble post
 
Take this.
data/movements/scripts
create arhchive.lua
name: car
LUA:
--credits to jordanhenry from otfans, do not redistribute without permission.
local CAR_ID = {1675, 1676, 1674, 1677}
function onStepIn(cid, item, pos, frompos)
    if isPlayer(cid) == TRUE then
        if item.actionid <= 100 or item.actionid == getPlayerAccountId(cid)+100 then
            local carpos = getThingPos(item.uid)
            addEvent(carMove, 200, {cid = cid, oldpos = carpos})
            doSetItemActionId(item.uid, getPlayerAccountId(cid)+100)
            doSetItemSpecialDescription(item.uid, "This vehicle belongs to "..getCreatureName(cid)..".")
        else
            doPlayerSendCancel(cid, "This vehicle does not belong to you.")
            doSendMagicEffect(pos, CONST_ME_POFF)
        end
    end
end

function carMove(param)
    local car = getThingfromPos(param.oldpos)
    local newpos = getPlayerLookPos(param.cid)
    if getDistanceBetween(getThingPos(param.cid), param.oldpos) == 0 and car.actionid == getPlayerAccountId(param.cid)+100 then
        if isInArray(CAR_ID, car.itemid) == TRUE then
            local tmp = newpos
            tmp.stackpos = 253
            if doTileQueryAdd(car.uid, newpos) == 1 and getTilePzInfo(newpos) == FALSE and isCreature(getThingFromPos(tmp).uid) == FALSE then
                local carid = CAR_ID[getPlayerLookDir(param.cid)+1]
                local newcar = doCreateItem(carid, 1, newpos)
                doSetItemActionId(newcar, car.actionid)
                doSetItemSpecialDescription(newcar, car.description)
                doRemoveItem(car.uid, 1)
                doTeleportThing(param.cid, newpos, FALSE)
                doSendMagicEffect(param.oldpos, CONST_ME_GROUNDSHAKER)
            end
        end
    end
    return TRUE
end

and

LUA:
--credits to jordanhenry from otfans, do not redistribute without permission.
function onUse(cid, item, frompos, item2, topos)
    if item.actionid == getPlayerAccountId(cid)+100 then
        doSetItemActionId(item.uid, 0)
        doSetItemSpecialDescription(item.uid, "")
        doSendMagicEffect(frompos, CONST_ME_HOLYAREA)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have disowned your vehicle.")
    end
    return TRUE
end

Here are Picture.
car.jpg


Link original
in TibiaHelp
http://tibiahelp.com/forum_thread_3596_Movement-Car-Script.html
 
Last edited:
Thanks it's working with this code:

Code:
--credits to jordanhenry from otfans, do not redistribute without permission.
local CAR_ID = {1675, 1676, 1674, 1677}
function onStepIn(cid, item, pos, frompos)
    if isPlayer(cid) == TRUE then
        if item.actionid <= 100 or item.actionid == getPlayerAccountId(cid)+100 then
            local carpos = getThingPos(item.uid)
            addEvent(carMove, 200, {cid = cid, oldpos = carpos})
            doItemSetAttribute(item.uid, "aid", getPlayerAccountId(cid)+100)
            doItemSetAttribute(item.uid, "description", "This vehicle belongs to "..getCreatureName(cid)..".")
        else
            doPlayerSendCancel(cid, "This vehicle does not belong to you.")
            doSendMagicEffect(pos, CONST_ME_POFF)
        end
    end
end
 
function carMove(param)
    local car = getThingfromPos(param.oldpos)
    local newpos = getPlayerLookPos(param.cid)
    if getDistanceBetween(getThingPos(param.cid), param.oldpos) == 0 and car.actionid == getPlayerAccountId(param.cid)+100 then
        if isInArray(CAR_ID, car.itemid) == true then
            local tmp = newpos
            tmp.stackpos = 253
            if doTileQueryAdd(car.uid, newpos) == 1 and getTilePzInfo(newpos) == FALSE and isCreature(getThingFromPos(tmp).uid) == FALSE then
                local carid = CAR_ID[getPlayerLookDir(param.cid)+1]
                local newcar = doCreateItem(carid, 1, newpos)
                doItemSetAttribute(newcar, "aid", car.actionid)
                doItemSetAttribute(newcar, "description", car.description)
                doRemoveItem(car.uid, 1)
                doTeleportThing(param.cid, newpos, FALSE)
                doSendMagicEffect(param.oldpos, CONST_ME_GROUNDSHAKER)
            end
        end
    end
    return true
end
But now i wanna have something that you have to hold the key to ride. not that it automatically drivers without holding the keys thanks:)

Edit:

And could somebody make that you have to right click on the car to get in? thanks:)
 
Last edited:
Back
Top