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

Frag Door

semary

[BB] OTland
Joined
May 3, 2009
Messages
813
Reaction score
18
Location
E G Y P T
i have idea i hope some one can help me in it

i want if player have more than 100 frag he can pass the door


SolvedThanks Cybershot
 
Last edited:
try this

Code:
local config = {
	uniqueid = 1000, -- action id that the door needs to have
	frags = 100, --- how many frags to enter
	direction = 1 --- 1 = up, 2 = right, 3 = down, 4 = left
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = getThingPos(cid)
	if item.uniqueid == config.uniqueid then
		if getPlayerFrags(cid) >= config.frags then
		local pos = {{x=v.x,y=v.y-2,z=v.z},{x=v.x+2,y=v.y,z=v.z},{x=v.x,y=v.y+2,z=v.z},{x=v.x-2,y=v.y,z=v.z}}
			doTeleportThing(cid,pos[config.direction],false)
			return doSendMagicEffect(pos[config.direction],10)
		else
			doPlayerSendTextMessage(cid,20,'You need '..config.frags' frags to enter this door.')
			return doSendMagicEffect(v,2)
		end
	end
end
 
try this

Code:
local config = {
	uniqueid = 1000, -- action id that the door needs to have
	frags = 100, --- how many frags to enter
	direction = 1 --- 1 = up, 2 = right, 3 = down, 4 = left
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = getThingPos(cid)
	if item.uniqueid == config.uniqueid then
		if getPlayerFrags(cid) >= config.frags then
		local pos = {{x=v.x,y=v.y-2,z=v.z},{x=v.x+2,y=v.y,z=v.z},{x=v.x,y=v.y+2,z=v.z},{x=v.x-2,y=v.y,z=v.z}}
			doTeleportThing(cid,pos[config.direction],false)
			return doSendMagicEffect(pos[config.direction],10)
		else
			doPlayerSendTextMessage(cid,20,'You need '..config.frags' frags to enter this door.')
			return doSendMagicEffect(v,2)
		end
	end
end

work :) 100%
 
done that error show

[04/07/2010 06:37:12] [Warning - Actions::registerEvent] Duplicate registered item with id: 6252, in fromid: 6249 and toid: 6266
 
i swar i kind of try every door he give me this errors

[04/07/2010 07:50:41] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/teleport.lua: No such file or directory
[04/07/2010 07:50:41] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/teleport.lua)
[04/07/2010 07:50:41] cannot open data/actions/scripts/teleport.lua: No such file or directory
[04/07/2010 07:50:41] [Warning - Actions::registerEvent] Duplicate registered item with id: 8553, in fromid: 8541 and toid: 8558
[04/07/2010 07:50:41] Reloaded actions.
[04/07/2010 07:51:29] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/teleport.lua: No such file or directory
[04/07/2010 07:51:29] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/teleport.lua)
[04/07/2010 07:51:29] cannot open data/actions/scripts/teleport.lua: No such file or directory
[04/07/2010 07:51:29] [Warning - Actions::registerEvent] Duplicate registered item with id: 6898, in fromid: 6891 and toid: 6908
[04/07/2010 07:51:29] Reloaded actions.
[04/07/2010 07:52:16] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/teleport.lua: No such file or directory
[04/07/2010 07:52:16] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/teleport.lua)
[04/07/2010 07:52:16] cannot open data/actions/scripts/teleport.lua: No such file or directory
[04/07/2010 07:52:16] [Warning - Actions::registerEvent] Duplicate registered item with id: 6257, in fromid: 6249 and toid: 6266
[04/07/2010 07:52:16] Reloaded actions.
[04/07/2010 07:52:31] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/teleport.lua: No such file or directory
[04/07/2010 07:52:31] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/teleport.lua)
[04/07/2010 07:52:31] cannot open data/actions/scripts/teleport.lua: No such file or directory
[04/07/2010 07:52:31] [Warning - Actions::registerEvent] Duplicate registered item with id: 6252, in fromid: 6249 and toid: 6266
[04/07/2010 07:52:31] Reloaded actions.
 
make sure the script is in the script folder and show me your xml tag for that script. Because it says that there is not such file in the directory
and that can be also that in your xml tag you misspelled the directory where the script is located.
 
i add it in actions



<action uniqueid="1000" event="script" value="fragdoor.lua" />
if you add it in other you must
<action uniqueid="1000" event="script" value="other/fragdoor.lua" />
if in quests quests/fragdoor
if in tools tools/fragdoor
if in liquids liquids/fragdoor
if in scripts fragdoor

thx
 
LUA:
        <action itemid="6252" event="script" value="fragdoor.lua"/>

LUA:
local config = {
	uniqueid = 1000, -- action id that the door needs to have
	frags = 100, --- how many frags to enter
	direction = 1 --- 1 = up, 2 = right, 3 = down, 4 = left
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = getThingPos(cid)
	if item.uniqueid == config.uniqueid then
		if getPlayerFrags(cid) >= config.frags then
		local pos = {{x=v.x,y=v.y-2,z=v.z},{x=v.x+2,y=v.y,z=v.z},{x=v.x,y=v.y+2,z=v.z},{x=v.x-2,y=v.y,z=v.z}}
			doTeleportThing(cid,pos[config.direction],false)
			return doSendMagicEffect(pos[config.direction],10)
		else
			doPlayerSendTextMessage(cid,20,'You need '..config.frags' frags to enter this door.')
			return doSendMagicEffect(v,2)
		end
	end
end
 
@up

PHP:
      <action uniqueid="6252" event="script" value="fragdoor.lua"/>




PHP:
local config = {
        uniqueid = 6252, -- action id that the door needs to have
        frags = 100, --- how many frags to enter
        direction = 1 --- 1 = up, 2 = right, 3 = down, 4 = left
        }

function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = getThingPos(cid)
        if item.uniqueid == config.uniqueid then
                if getPlayerFrags(cid) >= config.frags then
                local pos = {{x=v.x,y=v.y-2,z=v.z},{x=v.x+2,y=v.y,z=v.z},{x=v.x,y=v.y+2,z=v.z},{x=v.x-2,y=v.y,z=v.z}}
                        doTeleportThing(cid,pos[config.direction],false)
                        return doSendMagicEffect(pos[config.direction],10)
                else
                        doPlayerSendTextMessage(cid,20,'You need '..config.frags' frags to enter this door.')
                        return doSendMagicEffect(v,2)
                end
        end
end
 
Back
Top