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

Solved New players get letter with information! :)

L

LordVissie

Guest
Hey boys and girls, I'm searching for a script that gives the new players (so on the first login) a letter with text in it. I'm trying to learn to understand and make scripts but I only maked a Nightmare Doll say "Raawr!" and a doll that gives you exp :cool::cool: so I think I'm not able to make a script like this Haha :).

If someone knows something, post it here :D

Kind regards,

LordVissie :p:p

0.3.6
 
Last edited by a moderator:
I imagine something like this would work.

Code:
player:addItem("letter", 1):setAttribute(ITEM_ATTRIBUTE_TEXT, "Letter content goes here.")

Red
 
I imagine something like this would work.

Code:
player:addItem("letter", 1):setAttribute(ITEM_ATTRIBUTE_TEXT, "Letter content goes here.")

Red
He stated he's using 0.3.6 so that kinda won't help :|

Luckily, there are still idiots around here using 0.3.6. I am one of those idiots.
attachment.php


Put this inside of your creaturescripts/scripts/login.lua:


local firstLogStorage = 5757

if getPlayerStorageValue(cid, firstLogStorage) == -1 then
local textForLetter = "Some text here." -- You can put \n inside the string to make a new row
local letter = doPlayerAddItem(cid, LETTER_ID_HERE, 0)
setPlayerStorageValue(cid, firstLogStorage, 1)
doSetItemText(letter, textForLetter, "Name of the Sender")
end
 
@Shadowsong I added my version later he couldnt know my bad, I will test it when im home thanks for the help guys ;)
Ah, I see. I'm sure someone else will find their post(s) useful, whoever tries to do the same thing on 1.0+
The code snipped i posted should work, let me know if there are any problems when you test it out.
 
Works really nice thanks, btw I changed it to 6103 (Unholy book) cuz It's looks way cooler in my opion :p


Thanks guys :)

Shadow, btw ur Sprites :eek::cool:
 
Back
Top