• 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

Something like this:?

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local money = 4000000 -- how much money you need.
	local pos = {X = xxx, Y = yyy, Z = z} -- were to be teleported.
	if getPlayerMoney == money then
		doPlayerRemoveMoney(cid, money)
		doTeleportThing(cid, pos)
	else
		doPlayerSendTextMessage(cid,22,'You need 400cc to enter here.')
	end
end

Haven't tested it :p
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local money = 4000000 -- how much money you need.
	local pos = {X = xxx, Y = yyy, Z = z} -- where to be teleported.
	if getPlayerMoney >= money then
		doPlayerRemoveMoney(cid, money)
		doTeleportThing(cid, pos)
	else
		doPlayerSendTextMessage(cid,22,'You need " .. money .. " gold coins to enter here.')
	end
end
 
how i add on this script a min level ??
function onUse(cid, item, fromPosition, itemEx, toPosition)
local money = 4000000 -- how much money you need.
local pos = {X = xxx, Y = yyy, Z = z} -- where to be teleported.
local level == 1000
if getPlayerMoney >= money and getPlayerLevel(cid) >= level then
doPlayerRemoveMoney(cid, money) doTeleportThing(cid, pos)
elseif getPlayerLevel(cid) <= level then
doPlayerSendTextMessage(cid,22,'You are to low level for this.')
else doPlayerSendTextMessage(cid,22,'You need " .. money .. " gold coins to enter here.') end
end
return true
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local money = 4000000 -- how much money you need.
local pos = {X = xxx, Y = yyy, Z = z} -- where to be teleported.
local level == 1000
if getPlayerMoney >= money and getPlayerLevel(cid) >= level then
doPlayerRemoveMoney(cid, money) doTeleportThing(cid, pos)
elseif getPlayerLevel(cid) <= level then
doPlayerSendTextMessage(cid,22,'You are to low level for this.')
else doPlayerSendTextMessage(cid,22,'You need " .. money .. " gold coins to enter here.') end
end
return true
end
Code:
local money = 4000000 -- how much money you need.
local pos = {X = xxx, Y = yyy, Z = z} -- where to be teleported.
local level = 1000

local c = {
    con = function(id) return getPlayerLevel(id) >= level, getPlayerMoney(id) >= money end,
    msg = {'You are to low level for this.', 'You need ' .. money .. ' gold coins to enter here.', 'off we go!'},
    i = 1
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local condition, x = {c.con(cid)}, c.i
    if condition[1] then
        x = 2
        if condition[2] then
            x = 3
            doPlayerRemoveMoney(cid, money)
            doTeleportThing(cid, pos)
        end
    end
    doPlayerSendTextMessage(cid,22, c.msg[x])
    return true
end
 
Code:
local money = 4000000 -- how much money you need.
local pos = {X = xxx, Y = yyy, Z = z} -- where to be teleported.
local level = 1000

local c = {
    con = function(id) return getPlayerLevel(id) >= level, getPlayerMoney(id) >= money end,
    msg = {'You are to low level for this.', 'You need ' .. money .. ' gold coins to enter here.', 'off we go!'},
    i = 1
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local condition, x = {c.con(cid)}, c.i
    if condition[1] then
        x = 2
        if condition[2] then
            x = 3
            doPlayerRemoveMoney(cid, money)
            doTeleportThing(cid, pos)
        end
    end
    doPlayerSendTextMessage(cid,22, c.msg[x])
    return true
end
wow wth? why you made the code ugly :S ?
 
thanks very much for your consideration/support.
but, I had problems with the 'teleportthing', I was not telep. to the position.
I wonder what would . You can help me ?

tks
 
thanks very much for your consideration/support.
but, I had problems with the 'teleportthing', I was not telep. to the position.
I wonder what would . You can help me ?

tks
A little more information would be helpful, like what did you edit/add to the script?

Post the script for christ sakes... are you people retarded?
 
A little more information would be helpful, like what did you edit/add to the script?

Post the script for christ sakes... are you people retarded?

sry.. here it's'

local money = 4000000 -- how much money you need.
local pos = {X = 160, Y = 60, Z = 7} -- where to be teleported.
local level = 1000

local c = {
con = function(id) return getPlayerLevel(id) >= level, getPlayerMoney(id) >= money end,
msg = {'You are to low level for this.', 'You need ' .. money .. ' gold coins to enter here.', 'off we go!'},
i = 1
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local condition, x = {c.con(cid)}, c.i
if condition[1] then
x = 2
if condition[2] then
x = 3
doPlayerRemoveMoney(cid, money)
doTeleportThing(cid, pos)
end
end
doPlayerSendTextMessage(cid,22, c.msg[x])
return true
end
 
sry.. here it's'

local money = 4000000 -- how much money you need.
local pos = {X = 160, Y = 60, Z = 7} -- where to be teleported.
local level = 1000

local c = {
con = function(id) return getPlayerLevel(id) >= level, getPlayerMoney(id) >= money end,
msg = {'You are to low level for this.', 'You need ' .. money .. ' gold coins to enter here.', 'off we go!'},
i = 1
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local condition, x = {c.con(cid)}, c.i
if condition[1] then
x = 2
if condition[2] then
x = 3
doPlayerRemoveMoney(cid, money)
doTeleportThing(cid, pos)
end
end
doPlayerSendTextMessage(cid,22, c.msg[x])
return true
end

Try this
Code:
local money = 4000000 -- how much money you need.
local pos = {X = 160, Y = 60, Z = 7} -- where to be teleported.
local level = 1000

local c = {
con = function(id) return getPlayerLevel(id) >= level, getPlayerMoney(id) >= money end,
msg = {'You are to low level for this.', 'You need ' .. money .. ' gold coins to enter here.', 'off we go!'},
i = 1
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local condition, x = {c.con(cid)}, c.i
if condition[1] then
x = 2
if condition[2] then
x = 3
doPlayerRemoveMoney(cid, money)
doTeleportThing(cid, pos, TRUE)
end
end
doPlayerSendTextMessage(cid,22, c.msg[x])
return true
end
 
Try this
Code:
local money = 4000000 -- how much money you need.
local pos = {X = 160, Y = 60, Z = 7} -- where to be teleported.
local level = 1000

local c = {
con = function(id) return getPlayerLevel(id) >= level, getPlayerMoney(id) >= money end,
msg = {'You are to low level for this.', 'You need ' .. money .. ' gold coins to enter here.', 'off we go!'},
i = 1
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local condition, x = {c.con(cid)}, c.i
if condition[1] then
x = 2
if condition[2] then
x = 3
doPlayerRemoveMoney(cid, money)
doTeleportThing(cid, pos, TRUE)
end
end
doPlayerSendTextMessage(cid,22, c.msg[x])
return true
end
please stop... you don't know how to code... just stop
 
Back
Top