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

Book of Namelock

KrychaXX

New Member
Joined
Apr 22, 2008
Messages
91
Reaction score
0
Hi all. I search script Book Namelock TFS 0.3.6 , this book unlock in acc change nick, please give script or link :)

Instructions:
1. I buy this book, right click on the book
2. Book disappears
3. In acc i have possibility to change nick
 
Lua:
local config = {
	player = getPlayerByNameWildcard(cid),
	name = 'book of namelock',
	bm = '%s used a %s and is now namelocked.'
	}

function onUse(cid,item,itemEx,fromPosition,toPosition)
	if not(isPlayerNamelocked(cid))then
		doAddNamelock(cid)
		return doBroadcastMessage(string.format(config.bm,config.player,article,config.name))
	end
end

try this,
not sure if the broadcasting works, I'm new with string.format
 
Last edited:
Thx, i try and edit post :)

@Edit
Dont work :/
I add this script to actions, correctly?

This is line actions.xml
<action itemid="8983" script="bookname.lua"/>

[Error - Action Interface]
data/actions/scripts/bookname.lua:eek:nUse
Description:
data/actions/scripts/bookname.lua:8: attempt to call global 'isPlayerNamelocked' (a nil value)
stack traceback:
data/actions/scripts/bookname.lua:8: in function <data/actions/scripts/bookname.lua:7>

[Error - Action Interface]
data/actions/scripts/bookname.lua:eek:nUse
Description:
data/actions/scripts/bookname.lua:8: attempt to call global 'isPlayerNamelocked' (a nil value)
stack traceback:
data/actions/scripts/bookname.lua:8: in function <data/actions/scripts/bookname.lua:7>
 
Last edited:
[Error - Action Interface]
data/actions/scripts/bookname.lua:eek:nUse
Description:
data/actions/scripts/bookname.lua:8: attempt to call global 'isPlayerNamelocked' (a nil value)
stack traceback:
data/actions/scripts/bookname.lua:8: in function <data/actions/scripts/bookname.lua:7>

[Error - Action Interface]
data/actions/scripts/bookname.lua:eek:nUse
Description:
data/actions/scripts/bookname.lua:8: attempt to call global 'isPlayerNamelocked' (a nil value)
stack traceback:
data/actions/scripts/bookname.lua:8: in function <data/actions/scripts/bookname.lua:7>
 
that's how it's supposed to go:
Code:
isPlayerNameLocked(getCreatureName(cid))

Edit:
Here, tell me if it works:
Code:
function onUse(cid,item,itemEx,fromPosition,toPosition)
        if not(isPlayerNameLocked(getCreatureName(cid)))then
                doAddNamelock(cid)
		doRemoveCreature(cid, true)
        end
	return true	
end
Why broadcast? there's no need for it since all he wants is a script that namelocks the player, so the player can
change his name when he logs in.
 
Last edited:
Back
Top