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

[Talkaction] Help please!

fexark

New Member
Joined
May 3, 2009
Messages
89
Reaction score
0
Hello i was searching on forum but i never found a talkaction that when u reach lvl 50 u get a message sayng :
You reached lvl 50, say !lvl50 to go lvl 50 chest room!.


And u say !lvl 50 and u get teleported to a chest room, but you can use that command only 1 time and only when u are 50 +! pls help!!! :D
 
lvl 50 notification and storagevalue to teleport
Lua:
local config = {
	skill = SKILL__LEVEL,
	level = 50, --LVL notification
	storage = 60000, --Change the storages
				}


function onAdvance(cid, skill, oldlevel, newlevel)
	
	if skill == config.skill and config.level == newlevel then
		doPlayerSendTextMessage(cid, 21, 'Dear '..getPlayerName(cid)..'!\nAs a reward for reaching level 50 you can teleport to the chest room now. Type !lvl50 to teleport!')
		setPlayerStorageValue(cid, config.storage, 1)
	end
return true
end

talkaction

Lua:
local telepos = {x= , y= , z=}

function onSay(cid, words, param, channel)
		
	if getPlayerStorageValue(cid, 60000) == 1 then
		doTeleportThing(cid, telepos)
		doPlayerSendTextMessage(cid, 22, 'You got teleported to the chest room!')
		setPlayerStorageValue(cid, 60000, 2)
	else
		doPlayerSendCancel(cid, 'You cannot use this talkaction.')
	end
return true
end

in talkactions.xml add
Lua:
<talkaction words="!lvl50" event="script" value="lvl50.lua"/>

Yah, Cyko may post his/her shortstyle version, but I'd like to see it ;)

Edit: Edited :p
 
Last edited:
Code:
local telepos = {x= , y= , z=}

function onSay(cid, words, param, channel)
	if getPlayerStorageValue(cid, 60000) == 1 then
		doTeleportThing(cid, telepos)
		doSendMagicEffect(telepos, CONST_ME_TELEPORT)
		doPlayerSendTextMessage(cid, 22, 'You got teleported to the chest room!')
		setPlayerStorageValue(cid, 60000, 2)
	else
		doPlayerSendCancel(cid, 'You cannot use this command.')
	end
	return true
end
 
Whops, Copy/Paste failure :eek:
Psst, tell noone about that >.<

Edit: Cyko what's up with your shortcut version? :eek:
I was looking forward to it :(
No offense! I wan't to copy that :D
 
Whops, Copy/Paste failure :eek:
Psst, tell noone about that >.<

Edit: Cyko what's up with your shortcut version? :eek:
I was looking forward to it :(
No offense! I wan't to copy that :D
Code:
local telepos = {x= , y= , z=}

function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 60000) == 1 and doTeleportThing(cid, telepos) and doSendMagicEffect(telepos, CONST_ME_TELEPORT) and doPlayerSendTextMessage(cid, 22, 'You got teleported to the chest room!') and setPlayerStorageValue(cid, 60000, 2) or doPlayerSendCancel(cid, 'You cannot use this command.')
end
 
Code:
local telepos = {x= , y= , z=}

function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 60000) == 1 and doTeleportThing(cid, telepos) and doSendMagicEffect(telepos, CONST_ME_TELEPORT) and doPlayerSendTextMessage(cid, 22, 'You got teleported to the chest room!') and setPlayerStorageValue(cid, 60000, 2) or doPlayerSendCancel(cid, 'You cannot use this command.')
end

Fwiek! ;S
 
:p please, i want it work, shoul i put something on creaturescripts.xml or not ? yes or no ? plssss Answe zynta help me please i rellay need it :D
 
Ok I'll help you out.

ToDo-List as an OTServer host:

Read every tutorial available on every forum.
Learn how to manipulate the scripts to fit your needs.
Keep practicing the basics of LUA/XML/PHP (C++, but that's optional)
Search for advice and implement it yourself.


If you don't do that then your server won't last a week.
That's my advice for you.
 
That's why you fail at scripting!

*just joking*

Noone got hurt when he was reading a good tutorial, atleast that I know of.

I guess I made a mistake.
PM from him:
fexark said:
Ye or not :p? plsss answer

data/creaturescripts.xml add this line:
Lua:
<event type="advance" name="lvl50" event="script" value="lvl50.lua"/>

data/creaturescripts/scripts create a new file called lvl50.lua

Lua:
  local config = {
        skill = SKILL__LEVEL,
        level = 50, --LVL notification
        storage = 60000, --Change the storages
                                }


function onAdvance(cid, skill, oldlevel, newlevel)
       
        if skill == config.skill and config.level == newlevel then
                doPlayerSendTextMessage(cid, 21, 'Dear '..getPlayerName(cid)..'!\nAs a reward for reaching level 50 you can teleport to the chest room now. Type !lvl50 to teleport!')
                setPlayerStorageValue(cid, config.storage, 1)
        end
return true
end

data/creaturescripts/login.lua open it up, scroll to the bottom and add this line:

Lua:
registerCreatureEvent(cid, "lvl50")




I finally understand the reason why OpenTibia is dieing!
 
Arguecat.PNG
 
Back
Top