Sir Shutter
Learning LUA
I got some scripts, I want them fixed, they are easy, but its hard to fix it.. well they are 2 scripts I want to fix
More Information!!
In script 1 this is added to the movements.xml
In script 2 this is added to the talkactions.xml
The problem in script 1 is when i go on the teleport it just change my temple position, but it dont send the effect, neither it says "Welcome to Hawai!" I checked the itemID, I checked the position , I checked the unique id, everything is correct..
The problem in script 2 is when i say !buy "aol it says "Invalid item", I tryed !buy "backpack still invalid item, nothing works.
This may help :-
1. Im using TFS
2.TFS Version : 0.3.2.1345
3.For tibia 8.40 server.
Rep++
If you help :thumbup:
-: Script 1 :-
Code:
function onStepIn(cid, item, pos)
if item.uid == 2616 then
doPlayerSetTown(cid, 1)
doPlayerSendTextMessage(cid, 20, Welcome to Hawai!')
doSendMagicEffect({x=199,y=483,z=7},13)
end
-: Script 2 :-
Code:
-----------------------By Nahruto--------------------------
-------------------http://otfans.net/----------------------
function getPlayerMoney(cid)
gold = getPlayerItemCount(cid,2148)
plat = getPlayerItemCount(cid,2152)*100
crys = getPlayerItemCount(cid,2160)*10000
money = gold + plat + crys
return money
end
local items = {
["aol"] = {cash=10000, id=2173, amount=1},
["food"] = {cash=2000, id=2671, amount=100},
["backpack"] = {cash=100, id=1988, amount=1}
}
---------End Config ---------
function onSay(cid, words, param)
bitem = items[param]
if (bitem ~= nil) then
if getPlayerMoney(cid) >= bitem.cash then
doPlayerAddItem(cid,bitem.id,bitem.amount)
doPlayerRemoveMoney(cid,bitem.cash)
else
doPlayerSendCancel(cid,"Sorry, you dont have enough money")
end
else
doPlayerSendCancel(cid, "Invalid item.")
end
return 1
end
More Information!!
In script 1 this is added to the movements.xml
Code:
<movevent event="StepIn" itemid="1387" script="residence.lua"/>
In script 2 this is added to the talkactions.xml
Code:
<talkaction words="!buy" script="buy.lua" />
The problem in script 1 is when i go on the teleport it just change my temple position, but it dont send the effect, neither it says "Welcome to Hawai!" I checked the itemID, I checked the position , I checked the unique id, everything is correct..
The problem in script 2 is when i say !buy "aol it says "Invalid item", I tryed !buy "backpack still invalid item, nothing works.
This may help :-
1. Im using TFS
2.TFS Version : 0.3.2.1345
3.For tibia 8.40 server.
Rep++
If you help :thumbup: