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

[Action?] Skill door. / Gate of skill

Joined
Apr 22, 2008
Messages
114
Reaction score
10
Is it possible to make a door that would require a certain skill level to pass. like 50 fishing to get past this tile or door. or something like that. =] help please. will Reppp+++++

thanks.
 
LUA:
local t = {
	skill = SKILL_SWORD,
	skillLevel = 50
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerSkillLevel(cid, t.skill) >= t.skillLevel then
		if getCreaturePosition(cid).y < toPosition.y then
			doTeleportThing(cid, {x=toPosition.x, y=toPosition.y + 1, z=toPosition.z}, true)
		else
			doTeleportThing(cid, {x=toPosition.x, y=toPosition.y - 1, z=toPosition.z}, true)
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
	end
	
	return true
end
 
LUA:
local t = {
	skill = SKILL_SWORD,
	skillLevel = 50
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerSkillLevel(cid, t.skill) >= t.skillLevel then
		if getCreaturePosition(cid).y < toPosition.y then
			doTeleportThing(cid, {x=toPosition.x, y=toPosition.y + 1, z=toPosition.z}, true)
		else
			doTeleportThing(cid, {x=toPosition.x, y=toPosition.y - 1, z=toPosition.z}, true)
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
	end
	
	return true
end



thanks i will try it out
 
Yes because you have to edit the action id etc. So each one will be different.. In the actions.xml you edit the corresponding Action ID and done. And for each on just copy and paste the script and edit the skill... Done
 
im havin some issues i got this in
actions.xml


<action actionid="5550" script="tools/skilldoor.lua"/>


and this in skilldoor.lua

Code:
local t = {
	skill = SKILL_SWORD,
	skillLevel = 50
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerSkillLevel(cid, t.skill) >= t.skillLevel then
		if getCreaturePosition(cid).y < toPosition.y then
			doTeleportThing(cid, {x=toPosition.x, y=toPosition.y + 1, z=toPosition.z}, true)
		else
			doTeleportThing(cid, {x=toPosition.x, y=toPosition.y - 1, z=toPosition.z}, true)
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
	end
 
	return true
end


The door does and says nothing and i get alot of this in cmd


skilldooorrrrrrr.jpg
 
I think that means your server doesn't have the function getskilllevel.. :/ i know you can use for multiple doors, just not how to fix/create a new code, will have to wait for someone more experienced to check xD
 
Hmm thats what i thought, and after about 1 month editing and trying scripts i now understand what most of functions do and the basics within a script like, what is needed for lines etc, you will get hang of it soon :)
 
i was using mystic spirit i switched to this --> OTServ 8.70 r.6052 still no luck tho

mitch feel free to come see what i have going so far ;]
 
Last edited:
hmm I understand this..
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local skillid = 1-6 -- choose here which skill 

if getPlayerSkill(cid, skillid) == 100 then
end
return true
end
else
doPlayerSendCancel(cid, "Sorry, your skills is not high enough.")

and

for magic level is

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerMagLevel(cid) == 100 then
end
return true
end
else
doPlayerSendCancel(cid, "Sorry, your magic level is not high enough.")
 
hmm ok
try this

LUA:
local skills = { SKILL_FIST = 10, SKILL_CLUB = 10, SKILL_SWORD = 10, SKILL_AXE = 10, SKILL_DISTANCE = 10, SKILL_SHIELD = 10, SKILL_FISHING = 10 }
local magic = 100
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerMagLevel(cid, magic) == TRUE and getPlayerSkillLevel(cid, skills) == TRUE then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can pass!")
    else
	doPlayerSendCancel(cid, "Sorry, your stats are not high enough.")
    end
    return TRUE
end

* You can edit the skills and their levels to enter.
* You can edit the magic level needed to enter.
 
Back
Top