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

need script pay for door

Don't say sorry to Codex he is a fuck boy. He gave you a code that has no need to be set up the way it is. It is over complicated and would never help someone new learn the language. Thats the kind of dumb ass he is... If you want a more user-friendly one.

Code:
local money = 4000000
local level = 1000
local pos = {x = 160, y = 60, z = 7}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerMoney(cid) < money or getPlayerLevel(cid) < level then
        return doPlayerSendCancelMessage(cid, "Door requirements: [LEVEL]: "..level.." [MONEY]: "..money..".")
    end
    doPlayerRemoveMoney(cid, money)
    doTeleportThing(cid, pos)
return true
end

Codexs code is like this: If the player doesnt have it level it tells u not high enough level....So now you go get high enough level then go back....oh NOW it tells you you dont have 4kk....Now you have to go get 4kk...Wow, noob scripter if you ask me. Plus look at all those uneeded lines I mean jesus....
 
Don't say sorry to Codex he is a fuck boy. He gave you a code that has no need to be set up the way it is. It is over complicated and would never help someone new learn the language. Thats the kind of dumb ass he is... If you want a more user-friendly one.

Code:
local money = 4000000
local level = 1000
local pos = {x = 160, y = 60, z = 7}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerMoney(cid) < money or getPlayerLevel(cid) < level then
        return doPlayerSendCancelMessage(cid, "Door requirements: [LEVEL]: "..level.." [MONEY]: "..money..".")
    end
    doPlayerRemoveMoney(cid, money)
    doTeleportThing(cid, pos)
return true
end

Codexs code is like this: If the player doesnt have it level it tells u not high enough level....So now you go get high enough level then go back....oh NOW it tells you you dont have 4kk....Now you have to go get 4kk...Wow, noob scripter if you ask me. Plus look at all those uneeded lines I mean jesus....
Yep your code reflects your intellect.. simple code == simple minded no wonder you don't know anything :(
 
Codex, I wonder if you can explain what you added there to me "condition part" tried understanding it but failed.
c is a table, con is a property of c which is a function, it returns 2 values,
Code:
con = function(id) return getPlayerLevel(id) >= level, getPlayerMoney(id) >= money end,

Think of it like this
Code:
function con(id)
    return getPlayerLevel(id) >= level, getPlayerMoney(id) >= money
end

So if i pass cid to c.con its going to return 2 values.. which are boolean values, since its 2 values i placed them in a table and stored them in condition
Code:
local condition = {c.con(cid)}

Lets be hypothetical here, if c.con() returned say true and false, where condition[1] would hold the value of true and condition[2] would hold the value of false.

It would be like saying
Code:
local condition = {true, false}

So when i state
Code:
if condition[1] then
Whatever value condition[1] holds will make the if statement execute or not, same rules apply for condition[2]

This is not over kill, it just allows you to keep the code clean and not full of clutter like we see in a lot of scripts, sure its different, but you learn new ways of writing or executing code. :)

Believe me code can get excessively large and cumbersome.
 
Last edited:
Since we are on the door topic here is there a script to make a player pay 200 crystal coins to enter the door for 5 minutes and be kicked to temple after 5mins inside the door?
 
Since we are on the door topic here is there a script to make a player pay 200 crystal coins to enter the door for 5 minutes and be kicked to temple after 5mins inside the door?
Either use the search on this site or google, or start your own thread on the request boards.
 
Back
Top