Forum

> > CS2D > Scripts > Bank System For Tibia
Forums overviewCS2D overview Scripts overviewLog in to reply

English Bank System For Tibia

3 replies
To the start Previous 1 Next To the start

old Bank System For Tibia

Bangrangs
User Off Offline

Quote
add this to functions.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
bank={}

function initArray(m)
    local array = {}
    for i = 1, m do
        array[i]=0
    end
    return array
end

bank.skor=initArray(32)

function bank.update(id)
    parse('hudtxt2 '..id..' 48 "Bank Account: '..bank.skor[id]..' " 13 430')
end

add this to hooks.lua
1
2
3
4
addhook("spawn","bank.spawn")
function bank.spawn(id)
    bank.update(id)
end

add this to npcs.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
NPCs[2].func = function(npc, id, words, state)
     if words == "hi" then
          NPCspeak(npc, "Welcome.What you want deposit or check?'")
          PLAYERS[id].tmp.npcstate = {npc, 1}
     elseif contains(words, "bye") then
          NPCspeak(npc, "Goodbye sir.")
          PLAYERS[id].tmp.npcstate = nil
     elseif state == 1 then
		if contains(words, "deposit") then
        NPCspeak(npc, "Do you want to deposit 100$?")
		elseif state ==1 then
		if contains(words, "yes") then
		addmoney(id, -100)
        bank.skor[id]=bank.skor[id]+100
        bank.update(id)
		message(id, "Your cash added to bank.", "255255255")
		NPCspeak(npc, "Okay your progress saved.")
		elseif contains(wors, "bye") then
				NPCspeak(npc, "Goodbye sir.")
				PLAYERS[id].tmp.npcstate = nil
			end
		end
	end
end

If you are good coder you can add deposit and save bank money system good bye :d
edited 5×, last 22.07.14 02:59:56 pm

old Re: Bank System For Tibia

Bangrangs
User Off Offline

Quote
i ask yates and forum but nobody give me help. after i try to do :d (i do check system too.)

edit: i do save system.but not write here
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview