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

Door max level 20 enter!

gianflogao

Member
Joined
Jun 6, 2014
Messages
134
Solutions
2
Reaction score
13
hi guys

I need a door script (action) that only 20- (less) can access.

Base: Yurots 0.9.4f

Help-me Please!
 
Solution
Oh dude, you are missing a lot of things if that's the full script..
Try this one:
Code:
function onUse(cid, item, frompos, item2, topos)
local reqLevel = 20


    if getPlayerLevel(cid) <= reqLevel then
        pos = getPlayerPosition(cid)

            if pos.x == topos.x then
                if pos.y < topos.y then
                    pos.y = topos.y + 1
                else
                    pos.y = topos.y - 1
            end
            elseif pos.y == topos.y then
                if pos.x < topos.x then
                    pos.x = topos.x + 1
                else
                    pos.x = topos.x - 1
            end
            else
                doPlayerSendTextMessage(cid,22,'Stand in front of the door.')...
Lua:
backpos = {x=1000, y=1000, z=7}
if getPlayerLevel(cid) > 20 then
    doTeleportThing(cid, backpos)
end

Something like this. Or just edit scripts/leveldoor.lua and add condition.
 
Oh dude, you are missing a lot of things if that's the full script..
Try this one:
Code:
function onUse(cid, item, frompos, item2, topos)
local reqLevel = 20


    if getPlayerLevel(cid) <= reqLevel then
        pos = getPlayerPosition(cid)

            if pos.x == topos.x then
                if pos.y < topos.y then
                    pos.y = topos.y + 1
                else
                    pos.y = topos.y - 1
            end
            elseif pos.y == topos.y then
                if pos.x < topos.x then
                    pos.x = topos.x + 1
                else
                    pos.x = topos.x - 1
            end
            else
                doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
                return 1
            end

            doTeleportThing(cid, pos)
            doSendMagicEffect(topos, 12)
        else
            doPlayerSendTextMessage(cid,22,'Only levels under ' .. reqLevel .. ' can pass this door.')
        end
    return true
end

Have just edited the script again, if you find an error, try copying it again and replacing it.
 
Solution
Oh dude, you are missing a lot of things if that's the full script..
Try this one:
Code:
function onUse(cid, item, frompos, item2, topos)
local reqLevel = 20


    if getPlayerLevel(cid) <= reqLevel then
        pos = getPlayerPosition(cid)

            if pos.x == topos.x then
                if pos.y < topos.y then
                    pos.y = topos.y + 1
                else
                    pos.y = topos.y - 1
            end
            elseif pos.y == topos.y then
                if pos.x < topos.x then
                    pos.x = topos.x + 1
                else
                    pos.x = topos.x - 1
            end
            else
                doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
                return 1
            end

            doTeleportThing(cid, pos)
            doSendMagicEffect(topos, 12)
        else
            doPlayerSendTextMessage(cid,22,'Only levels under ' .. reqLevel .. ' can pass this door.')
        end
    return true
end

Have just edited the script again, if you find an error, try copying it again and replacing it.

It worked, but it's 20- (minus). lol
 
Im trying to use this with Version 0.2.15 (Mystic Spirit). It crashed my tibia client but not my console. No errors or anything besides the client crashing.
 
Why using such old TFS? OFC it is missing many functions or at least function name has changed.
Anyways I advise you to upgrade to higher TFS to have better performance/stability and better scripting functions.
Or If you decided to stuck with this version then link me to your source code or upload your luascript.cpp here and I will tell you which functions to change.
 
Why using such old TFS? OFC it is missing many functions or at least function name has changed.
Anyways I advise you to upgrade to higher TFS to have better performance/stability and better scripting functions.
Or If you decided to stuck with this version then link me to your source code or upload your luascript.cpp here and I will tell you which functions to change.
Is it possible for me to upgrade without extreme hassle and changing my client from 9.81? I have found that a lot of things would work better if I could upgrade. I don't even know where to start.
 
You can use this one, This has a datapack and source files based on TFS 1.1 works properly for client 9.81.
The upgrade process really depends on how big is your server but I think its better for your server if you started upgrading and feel free to post any issues while upgrading on the Support and we'll help you.
 

Attachments

  • Full Datapack TFS 1.1 Client 9.81.zip
    3.3 MB · Views: 8 · VirusTotal
You can use this one, This has a datapack and source files based on TFS 1.1 works properly for client 9.81.
The upgrade process really depends on how big is your server but I think its better for your server if you started upgrading and feel free to post any issues while upgrading on the Support and we'll help you.
I am nervous but I agree 100% its time to upgrade. I have been doing work around fixes for months and months for things. Thank you!

You can use this one, This has a datapack and source files based on TFS 1.1 works properly for client 9.81.
The upgrade process really depends on how big is your server but I think its better for your server if you started upgrading and feel free to post any issues while upgrading on the Support and we'll help you.
I dont even know where to start with those files. I didnt see anything to run a console so I tried replacing the files in my server with those files which didnt seem to work. No idea what to do :/
 
Last edited by a moderator:
Back
Top