Recommended Posts

Posted (edited)

Hello Everybody !

            Please help me to fix below script with XML file.

There's a XML file called 'codes.xml'. Inside of that XML file looks like below.

<pass characters="1234" allowed="true" />
<pass characters="5678" allowed="true" />
<pass characters="9012" allowed="true" />

Characters shown in above XML is used as a security key for open a certain door. Each character set can be used only once. There's a LUA script which is not completed yet can be seen below.

function open(player, command, code)
    if code then
	    ---
		
addCommandHandler("pass",open)

Well. If any player command as /pass 5678 , then the door will be open as security code is inserted in the previous XML file. But I need your help to make this work.

* When a player command, how to check that the security code is inserted in XML file ?

* When the security code is right, how to change corresponding allowed node to false ?

Edited by DeadthStrock

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.