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

Lua Welcome Screen at Login?

Bullet ProoF

New Member
Joined
Jan 14, 2014
Messages
22
Reaction score
0
Having trouble using a script that welcomes a player into server and gives him a summary of how the server is like this thread: http://otland.net/threads/welcome-book-script.172518/#post-1673907

The code I'm trying to use is this:
Code:
 if getPlayerStorageValue(cid, 55555) == -1 then
        setPlayerStorageValue(cid, 55555, 1)
        local text = 'First line\nSecond line\nThird line.'
        doItemSetAttribute(doPlayerAddItem(cid, 1950, 1), 'text', text)
    end



Using TFS 2.15

my error is:
attempt to call global 'doItemSetAttribute' (a nil value)
[11/06/2014 18:22:48] stack traceback:
[11/06/2014 18:22:48] [C]: in function 'doItemSetAttribute'
[11/06/2014 18:22:48] data/creaturescripts/scripts/login.lua:5: in function <data/creaturescripts/scripts/login.lua:1>


HELP! REP will DEFINITELY HAPPEN!
 
iirc tfs 0.2 doesn't got itemsetattribute function, only 0.3, you may try doSetItemText(uid, text) for 0.2 tho




PS: its version is 0.2.15 and not 2.15 =P this may confuse some ppl
 
This is the error I got:
Code:
[11/06/2014 20:27:18] Lua Script Error: [CreatureScript Interface]
[11/06/2014 20:27:18] data/creaturescripts/scripts/login.lua:onLogin
[11/06/2014 20:27:18] LuaScriptInterface::luaDoSetItemText(). Item not found
[11/06/2014 20:27:18] stack traceback:
[11/06/2014 20:27:18]     [C]: in function 'doSetItemText'
[11/06/2014 20:27:18]     data/creaturescripts/scripts/login.lua:5: in function <data/creaturescripts/scripts/login.lua:1>

[11/06/2014 20:27:18] Lua Script Error: [CreatureScript Interface]
[11/06/2014 20:27:18] data/creaturescripts/scripts/login.lua:onLogin
[11/06/2014 20:27:18] data/creaturescripts/scripts/login.lua:5: attempt to call a boolean value
[11/06/2014 20:27:18] stack traceback:
[11/06/2014 20:27:18]     [C]: at 0x00424730
[11/06/2014 20:27:18]     data/creaturescripts/scripts/login.lua:5: in function <data/creaturescripts/scripts/login.lua:1>




This is what my code looks like:
Code:
function onLogin(cid)
if getPlayerStorageValue(cid, 55555) == -1 then
        setPlayerStorageValue(cid, 55555, 1)
        local text = 'First line\nSecond line\nThird line.'
        doSetItemText(uid, text)(doPlayerAddItem(cid, 1950, 1), 'text', text)
    end
end
 
I'm not good at lua but try this one:

Code:
function onLogin(cid)
if getPlayerStorageValue(cid, 55555) == -1 then
        setPlayerStorageValue(cid, 55555, 1)
        local text = 'First line\nSecond line\nThird line.'
        local itemtxt = doPlayerAddItem(cid, 1950, 1)
        doSetItemText(itemtxt, text)
        return true
    end
end
 
It didnt pop up but the book does start in my characters backpack. Now the problem I have is that when I log on my GOD, since he has no cap and no EQ he bugs right away
 
maybe you are looking for something like doPlayerPopupFYI(cid, message) to popup a window with a message? and to fix your god just delete the item at database (phpmyadmin)
 
Ill try some more edits tomorrow but yeah, what I am looking for is basically to have a screen pop up that gives you a break down of everything you need to know about the server before you start playing.
 
try this dude

Code:
function onLogin(cid)
	if getPlayerStorageValue(cid, 55555) == -1 then
		setPlayerStorageValue(cid, 55555, 1)
		local text = 'First line\nSecond line\nThird line.'
		doShowTextDialog(cid, ITEM_ACTION_BOOK, text)
		return true
	end
end
 
Back
Top