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

Lua Beginner Tutorial

Evil Hero

Legacy Member
TFS Developer
Joined
Dec 12, 2007
Messages
1,246
Solutions
26
Reaction score
713
Location
Germany
Hello dear reader,

This Tutorial will show the "beginning" of learning LUA.
I'm going to break down the Tutorial in a few Steps and I try to explain everything commonly so everyone can understand it!

PART I - Functions...(What are they? What are they for?)

Functions are basicly just the thing which tells the server what you want to be happen with this Script.
There are many functions but you have to Split them into 2 Groups.

Group 1: The "Primary Functions" those functions are always listened at the very first start of a Script they tell what kind of action will be executed now.
Group 2: The "Secondary Functions" those functions are always ordered under the "Primary Function" but they are as important as the "Primary Functions".

Now we go into Details...

Let's start with the Primary Function.

Like I already stated those are the Functions which have to be ontop always. Let us go deeper into details so you'll understand why it is like that!

List of the "Primary Functions" NOTE (The Functions maybe variate depending on which server distro you use!)

Basic Ones: -- Going to explain them in this Tutorial

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
function onStepIn(cid, item, frompos, item2, topos)
function onStepOut(cid, item, frompos, item2, topos)
function onSay(cid, words, param)
function onEquip(cid, item, slot)
function onDeEquip(cid, item, slot)
function onAddItem(moveitem, tileitem, position)

Advanced Ones: -- Going to Explain them in another Tutorial

Code:
function onThink(cid)
function onLogin(cid)
function onLogout(cid)
function onKill(cid,target)
function onDeath(corpse,killer)

Those are the Functions which the Updated Distros have so far.

Let me explain you each function now...

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

Like you can easy guess this will make something happen when you use something

example:

You pull a lever and a wall will be created.


Code:
function onStepIn(cid, item, frompos, item2, topos)

This will make something happen when you walk on a specificated tile, yes you heard right this one will ONLY be executed when you walk on a tile.

example:

You walk on a tile and get an welcome message.


Code:
function onStepOut(cid, item, frompos, item2, topos)

This one is just the difference from "onStepIn" this one ONLY works when you step from a specificated tile.

example:

You walk from a tile and will be teleported to another position.


Code:
function onSay(cid, words, param)

This one will only work when a player says a specificated word which will execute the script then...

example:

The Player has to say "!Quest" to start an quest.


Code:
function onEquip(cid, item, slot)

To get this in order to work you have to put an item into one of your equipment slots.

example:

You put an Crown armor into your Body Equipment Slot.


Code:
function onDeEquip(cid, item, slot)

Almost same as "onEquip" but in order to get it work you have to put off an item from your Equipment Slot.

example:

You put the Crown armor off from your Body Equipment Slot.


Code:
function onAddItem(moveitem, tileitem, position)

This is one of the less used Functions but it's really usefull sometimes, you have to put an item on a specificated tile in order to get it to work.

example:

You put an Axe on a sacrfice table, the item will be gone and another item will be created.


This was a little explanation of the "Primary Functions"
You should now be able to recognise what usage which function has.

"Secondary" List: -- Latest Function List from TFS Alpha 0.4

Code:
//get*
	getCreatureHealth(cid)
	getCreatureMaxHealth(cid)
	getCreatureMana(cid)
	getCreatureMaxMana(cid)
	getCreatureMaster(cid)
	getCreatureSummons(cid)
	getCreatureOutfit(cid)
	getCreaturePosition(cid)
	getCreatureName(cid)
	getCreatureSpeed(cid)
	getCreatureBaseSpeed(cid)
	getCreatureTarget(cid)
	getCreatureByName(name)
	getCreatureCondition(cid, condition)
	getMonsterTargetList(cid)
	getMonsterFriendList(cid)
	getPlayerLossSkill(cid)
	getPlayerLossPercent(cid, lossType)
	getPlayerGUIDByName(name)
	getPlayerNameByGUID(guid)
	getPlayerFood(cid)
	getPlayerLevel(cid)
	getPlayerExperience(cid)
	getPlayerMagLevel(cid)
	getPlayerSpentMana(cid)
	getPlayerAccess(cid)
	getPlayerSkillLevel(cid, skillid)
	getPlayerSkillTries(cid, skillid)
	getPlayerTown(cid)
	getPlayerVocation(cid)
	getPlayerRequiredMana(cid, magicLevel)
	getPlayerRequiredSkillTries(cid, skillId, skillLevel)
	getPlayerItemCount(cid, itemid)
	getPlayerSoul(cid)
	getPlayerFreeCap(cid)
	getPlayerLight(cid)
	getPlayerSlotItem(cid, slot)
	getPlayerWeapon(cid[, ignoreAmmo])
	getPlayerItemById(cid, deepSearch, itemId[, subType])
	getPlayerDepotItems(cid, depotid)
	getPlayerGuildId(cid)
	getPlayerGuildName(cid)
	getPlayerGuildRank(cid)
	getPlayerGuildNick(cid)
	getPlayerGuildLevel(cid)
	getPlayerSex(cid)
	getPlayerLookDir(cid)
	getPlayerStorageValue(uid, valueid)
	getPlayerGUID(cid)
	getPlayerFlagValue(cid, flag)
	getPlayerCustomFlagValue(cid, flag)
	getPlayerPromotionLevel(cid)
	getPlayerGroupId(cid)
	getPlayerLearnedInstantSpell(cid, name)
	getPlayerInstantSpellCount(cid)
	getPlayerInstantSpellInfo(cid, index)
	getPlayerSex(cid)
	getPlayerBlessing(cid, blessing)
	getPlayerStamina(cid)
	getPlayerNoMove(cid)
	getPlayerExtraExpRate(cid)
	getPlayerPartner(cid)
	getPlayerParty(cid)
	getPlayerPremiumDays(cid)
	getPlayerSkullType(cid)
	getPlayerBalance(cid)
	getPlayersByAccountNumber(accountNumber)
	getPlayersByIP(ip[, mask = 0xFFFFFFFF])
	getInstantSpellInfoByName(cid, name)
	getInstantSpellWords(name)
	getPartyMembers(lid)
	getAccountNumberByName(name)
	getIPByName(name)
	getHouseOwner(houseid)
	getHouseName(houseid)
	getHouseEntry(houseid)
	getHouseRent(houseid)
	getHousePrice(houseid)
	getHouseTown(houseid)
	getHouseAccessList(houseid, listid)
	getHouseByPlayerGUID(playerGUID)
	getHouseTilesSize(houseid)
	getItemRWInfo(uid)
	getItemDescriptionsById(itemid)
	getItemNameById(itemid)
	getItemPluralNameById(itemid)
	getItemIdArticleById(itemid)
	getItemWeightById(itemid, count[, precise])
	getItemDescriptions(uid)
	getItemName(uid)
	getItemPluralName(uid)
	getItemIdArticle(uid)
	getItemAttack(uid)
	getItemExtraAttack(uid)
	getItemDefense(uid)
	getItemExtraDefense(uid)
	getItemArmor(uid)
	getItemAttackSpeed(uid)
	getItemHitChance(uid)
	getItemIdByName(name)
	getContainerSize(uid)
	getContainerCap(uid)
	getContainerCapById(itemid)
	getContainerItem(uid, slot)
	getDepotId(uid)
	getTileItemById(pos, itemId[, subType])
	getTileItemByType(pos, type)
	getTileThingByPos(pos)
	getTilePzInfo(pos)
	getTileHouseInfo(pos)
	getClosestFreeTile(cid, targetpos)
	getThingfromPos(pos)
	getThing(uid)
	getThingPos(uid)
	getTemplePositionByName(townName)
	getTemplePositionById(townId)
	getTownName(townId)
	getWorldType()
	getWorldTime()
	getWorldLight()
	getWorldCreatures(type) //0 players, 1 monsters, 2 npcs, 3 all
	getWorldUpTime()
	getOnlinePlayers()
	getGlobalStorageValue(valueid)
	getSpectators(centerPos, rangex, rangey, multifloor)
	getTopCreature(pos)
	getVocationInfo(id)
	getGuildId(guildName)
	getFluidSourceType(type)
	getConfigFile()

	//set*
	setCreatureMaxHealth(cid, health)
	setCreatureMaxMana(cid, mana)
	setPlayerStorageValue(uid, valueid, newvalue)
	setPlayerGroupId(cid, newGroupId)
	setPlayerPromotionLevel(cid, level)
	setPlayerStamina(cid, minutes)
	setPlayerExtraExpRate(cid, value)
	setPlayerPartner(cid, guid)
	setHouseOwner(houseid, ownerGUID)
	setHouseAccessList(houseid, listid, listtext)
	setItemName(uid)
	setItemPluralName(uid)
	setItemIdArticle(uid)
	setItemAttack(uid, attack)
	setItemExtraAttack(uid, extraattack)
	setItemDefense(uid, defense)
	setItemArmor(uid, armor)
	setItemExtraDefense(uid, extradefense)
	setItemAttackSpeed(uid, attackspeed)
	setItemHitChance(uid, hitChance)
	setCombatArea(combat, area)
	setCombatCondition(combat, condition)
	setCombatParam(combat, key, value)
	setConditionParam(condition, key, value)
	setCombatCallBack(combat, key, function_name)
	setCombatFormula(combat, type, mina, minb, maxa, maxb)
	setConditionFormula(combat, mina, minb, maxa, maxb)
	setGlobalStorageValue(valueid, newvalue)
	setWorldType(type)

	//do*
	doCreatureAddHealth(cid, health)
	doCreatureAddMana(cid, mana)
	doCreatureSetDropLoot(cid, doDrop)
	doCreatureChangeOutfit(cid, outfit)
	doCreatureSay(cid, text, type)
	doSetCreatureLight(cid, lightLevel, lightColor, time)
	doSetCreatureOutfit(cid, outfit, time)
	doRemoveCreature(cid)
	doMoveCreature(cid, direction)
	doSummonCreature(name, pos)
	doConvinceCreature(cid, target)
	doChallengeCreature(cid, target)
	doChangeSpeed(cid, delta)
	doMonsterChangeTarget(cid)
	doSetMonsterTarget(cid, target)
	doSetMonsterOutfit(cid, name, time)
	doPlayerBroadcastMessage(cid, message[, type])
	doPlayerSetSex(cid, newSex)
	doPlayerSetTown(cid, townid)
	doPlayerSetVocation(cid,voc)
	doPlayerRemoveItem(cid, itemid, count[, subtype])
	doPlayerAddExp(cid, exp)
	doPlayerSetGuildId(cid, id)
	doPlayerSetGuildRank(cid, rank)
	doPlayerSetGuildNick(cid, nick)
	doPlayerAddOutfit(cid,looktype, addons)
	doPlayerRemoveOutfit(cid,looktype, addons)
	doPlayerSetLossPercent(cid, lossType, newPercent)
	doPlayerSetLossSkill(cid, doLose)
	doPlayerAddSkillTry(cid, skillid, n)
	doPlayerAddSpentMana(cid, amount)
	doPlayerAddSoul(cid, soul)
	doPlayerAddItem(uid, itemid[, count/subtype[, canDropOnMap]])
	doPlayerAddItemEx(cid, uid[, canDropOnMap])
	doPlayerSendTextMessage(cid, MessageClasses, message)
	doPlayerAddMoney(cid, money)
	doPlayerRemoveMoney(cid, money)
	doPlayerWithdrawMoney(cid, money)
	doPlayerDepositMoney(cid, money)
	doPlayerTransferMoneyTo(cid, target, money)
	doPlayerPopupFYI(cid, message)
	doPlayerSendTutorial(cid, id)
	doPlayerAddMapMark(cid, pos, type[, description])
	doPlayerAddPremiumDays(cid, days)
	doPlayerAddBlessing(cid, blessing)
	doPlayerAddStamina(cid, minutes)
	doPlayerSetNoMove(cid, cannotMove)
	doPlayerResetIdleTime(cid)
	doPlayerLearnInstantSpell(cid, name)
	doPlayerFeed(cid, food)
	doPlayerSendCancel(cid, text)
	doPlayerSendDefaultCancel(cid, ReturnValue)
	doCreateItem(itemid, type/count, pos)
	doCreateItemEx(itemid[, count/subtype])
	doAddContainerItemEx(uid, virtuid)
	doAddContainerItem(uid, itemid[, count/subtype])
	doChangeTypeItem(uid, newtype)
	doDecayItem(uid)
	doRemoveItem(uid[, n])
	doTransformItem(uid, toitemid[, count/subtype])
	doSetItemActionId(uid, actionid)
	doSetItemText(uid, text)
	doSetItemSpecialDescription(uid, desc)
	doSetItemOutfit(cid, item, time)
	doTileAddItemEx(pos, uid)
	doAddCondition(cid, condition)
	doRemoveCondition(cid, type)
	doAreaCombatHealth(cid, type, pos, area, min, max, effect)
	doTargetCombatHealth(cid, target, type, min, max, effect)
	doAreaCombatMana(cid, pos, area, min, max, effect)
	doTargetCombatMana(cid, target, min, max, effect)
	doAreaCombatCondition(cid, pos, area, condition, effect)
	doTargetCombatCondition(cid, target, condition, effect)
	doAreaCombatDispel(cid, pos, area, type, effect)
	doTargetCombatDispel(cid, target, type, effect)
	doCombat(cid, combat, param)
	doTeleportThing(cid, newpos[, pushmove])
	doCreateTeleport(itemid, topos, createpos)
	doSendMagicEffect(pos, type[, player])
	doSendDistanceShoot(frompos, topos, type)
	doSendAnimatedText(pos, text, color)
	doShowTextDialog(cid, itemid, text)
	doRelocate(pos, posTo)
	doBroadcastMessage(message, type)

	//is*
	isCreature(cid)
	isPlayer(cid)
	isPlayerPzLocked(cid)
	isPlayerGhost(cid)
	isItemStackable(itemid)
	isItemRune(itemid)
	isItemDoor(itemid)
	isItemLevelDoor(itemid)
	isItemContainer(itemid)
	isItemFluidContainer(itemid)
	isItemMovable(itemid)
	isContainer(uid)
	isCorpse(uid)
	isMovable(uid)
	isSightClear(fromPos, toPos, floorCheck)
	isInArray({array}, value)

	//others
	registerCreatureEvent(uid, eventName)
	createCombatArea({area}[, {exArea}])
	createConditionObject(type)
	addDamageCondition(condition, rounds, time, value)
	addOutfitCondition(condition, lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet)
	createCombatObject()
	numberToVariant(number)
	stringToVariant(string)
	positionToVariant(pos)
	targetPositionToVariant(pos)
	variantToNumber(var)
	variantToString(var)
	variantToPosition(var)
	canPlayerLearnInstantSpell(cid, name)
	queryTileAddThing(uid, pos[, flags])
	canPlayerWearOutfit(cid, looktype, addons)
	executeRaid(name)
	saveServer()
	cleanMap()
	shutdown()
	addEvent(callback, delay, ...)
	stopEvent(eventid)
	debugPrint(text)
	hasProperty(uid)

	//db table
	db.executeQuery(query)
	db.storeQuery(query)
	db.escapeString(str)
	db.escapeBlob(s, length)
	db.stringComparisonOperator()

	//result table
	result.getDataInt(resId, s)
	result.getDataLong(resId, s)
	result.getDataString(resId, s)
	result.getDataStream(resId, s, length)
	result.next(resId)
	result.free(resId)

	//bit table
	#bit.cast
	bit.bnot(n)
	bit.band(type, n)
	bit.bor(type, n)
	bit.bxor(type, n)
	bit.lshift(type, n)
	bit.rshift(type, n)
	#bit.arshift
	#bit.ucast
	bit.ubnot(n)
	bit.uband(type, n)
	bit.ubor(type, n)
	bit.ubxor(type, n)
	bit.ulshift(type, n)
	bit.urshift(type, n)
	#bit.uarshift


PART II - If...Else...Elseif...Return...End...(In which Order do I use them?)

In this Part we write our first Script.
NOTE! I wont make a Script for an Server so it will be easier to understand at the start...

Code:
if My Car is repaired then -- "if" is the start of something, "then" means what will happen now.
	I'll drive to work with it -- this will happen then
end -- everytime you start an "if" you have to "end" it!

this is the basic Structure of an Script...
but what do we do if the car isn't repaired?

Code:
if My Car is repaired then
	I'll drive to work with it
else -- "else" is used as an "single" counterpart of an "if", means basicly just that if the "if" is not true in this case the else will be read. NOTE an "else" doesn't need an extra "end"
	I'll go by Bike -- this will happen if the car is still not repaired.
end

I just noticed that my brother took my bike :( so what shall we do now?

Code:
if My Car is repaired then
	I'll drive to work with it
elseif My Bike is taken then -- This is similiar to "else" but the difference is that you can make different situations out of it. NOTE an "elseif" doesn't need an extra "end"
	I'll go by Bus -- will happen when my car is still not repaired.
end

The Bus left before I came. So I'll wait for the next Bus.

Code:
if My Car is repaired then
	I'll drive to work with it -- happens if the car is repaired.
elseif My Bike is taken then
	I'll go by Bus -- happens if my bike is taken.
elseif I miss the Bus then
	I'll wait for the next one -- happens if i miss the buss
end

Looks quite easy doesn't it?

Let's go for a Server Script now. (take a look at the Function List therefore)
This Script will be a switch which gives you an message when you pull it!

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		doPlayerSendTextMessage(cid,21,"It works !")
	elseif item.itemid == 1946 then
		doPlayerSendTextMessage(cid,21,"You pulled it back!")
	end
	return TRUE
end -- Every Function has to have an own "end" too.

Now the explanation..You maybe ask yourself now "wtf is item.itemid etc." Let me explain that a bit.

item.itemid == 1945 -- item.itemid stands for the item which we used to get the action to work, == is meant that it "equals" to the thing after. In this case 1945. (there are different types like "<"-- is smaller as,">"-- is greater as,"<="-- is smaller or same as,">="is greater or same as,"~="-- is not same as)
cid -- This reflects the Player who is starting the action currently.
21 -- In this case it's the number which stands for an color (not really necessary to know at the moment)
"it works !" -- The text which will we receive when we execute the script
return TRUE -- We have to return "TRUE" because we want something to happen, if we would return "FALSE" in this case we wouldn't get a message or anything else (You can return many other things aswell not just only "TRUE" or "FALSE")

Now you know the Basics of Scripting. Now you should be able to build an proper Structure and explain what it does.


PART III -- is greater as(>)....is smaller as(<)...is same as(==)...(How to use them correct?)


I'm not going to explain much now since we already know now how to build a Script. So we should start with expanding our Script which we made in PART II.

Let's say we wanna add an Level requirement on the Lever so that only lvl 50 or higher can pull it.

There are 2 ways in this case how we could do it.

1 Way:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 and getPlayerLevel(cid) >= 50 then
		doPlayerSendTextMessage(cid,21,"It works !")
	elseif item.itemid == 1946 and getPlayerLevel(cid) >= 50 then
		doPlayerSendTextMessage(cid,21,"You pulled it back!")
	end
	return TRUE
end

This would be the easy way to do it in this case.
But...The problem would be we cannot give the Player an error message when his level is under 50, so people will think the lever doesn't work.

2 Way:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		if getPlayerLevel(cid) >= 50 then -- we started another "if" which will only be read when the first "if" is seen as true in this case but that although means we have to make another "end" for it since we remember (each "if" has to have his own "end")
			doPlayerSendTextMessage(cid,21,"It works !")
		else
			doPlayerSendCancel(cid,"You don't have the required level.") -- error message If the Players level is to low.
		end
	elseif item.itemid == 1946 then
		if getPlayerLevel(cid) >= 50 then -- This "if" would only be read when the "elseif" statement would be true now.
			doPlayerSendTextMessage(cid,21,"You pulled it back!")
		else
			doPlayerSendCancel(cid,"You don't have the required level.") -- error message If the Players level is to low.
		end
	end
	return TRUE
end

This would be the best way how to do it even if it's a bit longer it gives us the chance to give the player an error message when his lvl isn't high enough.

Now we just set up some different situations, no need to make extra Scripts for this part

Code:
if getPlayerLevel(cid) < 50 then -- if the Player has an lower level then 50 it will work
if getPlayerLevel(cid) > 50 then -- if the Player has an higher level then 50 it will work.
if getPlayerLevel(cid) <= 50 then -- if the Player has an lower or the same level as 50 it will work.
if getPlayerLevel(cid) >= 50 then -- if the Player has an higher level or same level as 50 it will work.
if getPlayerLevel(cid) ~= 50 then -- if the Player doesn't have level 50 then it will work.
if getPlayerLevel(cid) == 50 then -- Only if the Player has level 50 then it will work.


This should have cleared your mind now, You should be able to use them in correct order like you want them now.



PART IV -- Local and Global Statements...(What are they for? When shall I use them?)

Both statements look almost the same with the difference that you have to write

Code:
local test = 1 -- In order to use a local statement and
test = 1 -- To use the Global

There is not much difference between them if you write them but they make a huge difference...

"local" is used in order for just inside a Script and the "global" is used to be executed for every file depending on your server!

Let's say it like this, if you use an "local" statement (local word = hello) then if i would write "word" in a script it would be seen as "hello" but ONLY in this Script!
If I would use an "global" statement, then everytime I write "word" it would mean "hello".

Question: Why shall i even use local or global statements? Isn't it easier to just write in what you want?
Answer: No it isn't! it can save up a lot of time if you have to use same things twice or even more!

example:

We add that the player recovers 500 mana/hp

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		if getPlayerLevel(cid) >= 50 then -- we started another "if" which will only be read when the first "if" is seen as true in this case but that although means we have to make another "end" for it since we remember (each "if" has to have his own "end")
			doPlayerSendTextMessage(cid,21,"It works !")
			doCreatureAddMana(cid,500)
			doCreatureAddHealth(cid,500)
		else
			doPlayerSendCancel(cid,"You don't have the required level.") -- error message If the Players level is to low.
		end
	elseif item.itemid == 1946 then
		if getPlayerLevel(cid) >= 50 then -- This "if" would only be read when the "elseif" statement would be true now.
			doPlayerSendTextMessage(cid,21,"You pulled it back!")
			doCreatureAddMana(cid,500)
			doCreatureAddHealth(cid,500)
		else
			doPlayerSendCancel(cid,"You don't have the required level.") -- error message If the Players level is to low.
		end
	end
	return TRUE
end

Seems fine...but what if I want to change the ammount to 750 now? I would have to edit every single number again...
This is basicly why we use local/global statements.

example:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local gain = 750
	if item.itemid == 1945 then
		if getPlayerLevel(cid) >= 50 then -- we started another "if" which will only be read when the first "if" is seen as true in this case but that although means we have to make another "end" for it since we remember (each "if" has to have his own "end")
			doPlayerSendTextMessage(cid,21,"It works !")
			doCreatureAddMana(cid,gain)
			doCreatureAddHealth(cid,gain)
		else
			doPlayerSendCancel(cid,"You don't have the required level.") -- error message If the Players level is to low.
		end
	elseif item.itemid == 1946 then
		if getPlayerLevel(cid) >= 50 then -- This "if" would only be read when the "elseif" statement would be true now.
			doPlayerSendTextMessage(cid,21,"You pulled it back!")
			doCreatureAddMana(cid,gain)
			doCreatureAddHealth(cid,gain)
		else
			doPlayerSendCancel(cid,"You don't have the required level.") -- error message If the Players level is to low.
		end
	end
	return TRUE
end

So if i would like to change the number now again I would just have to change the number behind the statement!



This is the End of the Tutorial, I hope that you learned much so you can start to Script your own things now! :D
 
Last edited:
Omg thank you very much!! very nice Tutorial and detailed.

im not good at scripting but i think it should bee like this becouse i can found doPlayerAddMana
in the funktion list

Edit.
1.
Code:
doPlayerAddMana(cid,500)
to
Code:
doCreatureAddMana(cid, 500)
2.
Code:
doPlayerAddMana(cid,gain)
to
Code:
doCreatureAddMana(cid, gain)
Im not sure :p
 
Last edited:
thx for telling me, I always forget to don't use my custom functions :p

Code:
function doPlayerAddMana(cid,mana)
     return doCreatureAddMana(cid,mana)
end

kind regards, Evil Hero
 
Awesome ;>
Thanks a lot , gonna start learning to script now XD (always wanted to be able to do scripts , i know the basics but i cant write complex scripts)
 
Awesome tutorial. I am a real script noob. But this tutorial made me understand alot more about the subject.


Rep+
 
I'm afraid so examples doesn't work (I mean I cannot see them ;P)

I can't tell you for sure why you don't see them, never heard about that kind of problem, but you could try to use another web browser that might help.


kind regards, Evil Hero
 
how can I have 2 primary functions on the same script?
it's for a spell that makes you go faster and at the same time buffs your skills.
by the way, great tutorial, learned a lot.
 
This rox :) ,but i learned for 2 weeks ago something i think :) but thanks for this tutorial really its learned me to fix errors and so, one more thing Mario :) Could you add like time/event ? and what its rep++ ? i see many times , how i give ?
 
Really extremely good tutorial. Just what I was searching for. Thanks really much.

A big rep++ there!
 
Back
Top