Tibia Requests
60 replies Yes i want someone like this But
You see ONIX CAVE
FULLMAP...
I want add the Same But i want ADD :
ICECAVE at the Position of the ice monsters Cave But when i wrte the Position of the monster
That's Not Spawn At the correct Place So i hope you will Help me Thanks
You see ONIX CAVE
FULLMAP...
I want add the Same But i want ADD :
ICECAVE at the Position of the ice monsters Cave But when i wrte the Position of the monster
That's Not Spawn At the correct Place So i hope you will Help me Thanks
PLAYERS[id].class = 1
PLAYERS[id].class = 2
PLAYERS[id].class = 3
not working !
PLAYERS[id].class = PLAYERS[id].class + (1, 2, 3)
!
PLAYERS[id].class = 2
PLAYERS[id].class = 3
not working !
PLAYERS[id].class = PLAYERS[id].class + (1, 2, 3)
!
edited 1×, last 15.04.13 02:28:32 pm
My youtube Channel http://www.youtube.com/user/ufuk500
Help To fix Class script
ERROR
HOOKS
COFING > PLAYERINIT
Funcions
AND
HOOKS
PLSS HELPE ME
ERROR
Code:
1
LUA ERROR: sys/lua/cs2dtibia/hooks.lua:12: attempt to compare number with nil
HOOKS
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
addhook("menu","C_menu",-1)
function C_menu(id,title,button)
if title == "Class" then
if button == 1 then
if PLAYERS[id].class == 0 then
PLAYERS[id].tmp.atk = PLAYERS[id].tmp.atk + 1
PLAYERS[id].tmp.def = PLAYERS[id].tmp.def - 7
PLAYERS[id].tmp.spd = PLAYERS[id].tmp.spd - 6
PLAYERS[id].cAtk2 = PLAYERS[id].cAtk2 + 1
PLAYERS[id].cDef2 = PLAYERS[id].cDef2 - 7
PLAYERS[id].cSpd2 = PLAYERS[id].cSpd2 - 6
PLAYERS[id].class = 1
else
message(id, "You need to reset your class first!")
end
elseif button == 2 then
if PLAYERS[id].class == 0 then
PLAYERS[id].tmp.atk = PLAYERS[id].tmp.atk - 0.75
PLAYERS[id].tmp.def = PLAYERS[id].tmp.def + 3
PLAYERS[id].tmp.spd = PLAYERS[id].tmp.spd - 1
PLAYERS[id].cAtk2 = PLAYERS[id].cAtk2 - 0.75
PLAYERS[id].cDef2 = PLAYERS[id].cDef2 + 3
PLAYERS[id].cSpd2 = PLAYERS[id].cSpd2 - 1
PLAYERS[id].class = 2
else
message(id, "You need to reset your class first!")
end
elseif button == 3 then
if PLAYERS[id].class == 0 then
PLAYERS[id].tmp.atk = PLAYERS[id].tmp.atk + 0.25
PLAYERS[id].tmp.def = PLAYERS[id].tmp.def + 1
PLAYERS[id].tmp.spd = PLAYERS[id].tmp.spd + 1
PLAYERS[id].cAtk2 = PLAYERS[id].cAtk2 + 0.25
PLAYERS[id].cDef2 = PLAYERS[id].cDef2 + 1
PLAYERS[id].cSpd2 = PLAYERS[id].cSpd2 + 1
PLAYERS[id].class = 3
else
message(id, "You need to reset your class first!")
end
end
end
end
function C_menu(id,title,button)
if title == "Class" then
if button == 1 then
if PLAYERS[id].class == 0 then
PLAYERS[id].tmp.atk = PLAYERS[id].tmp.atk + 1
PLAYERS[id].tmp.def = PLAYERS[id].tmp.def - 7
PLAYERS[id].tmp.spd = PLAYERS[id].tmp.spd - 6
PLAYERS[id].cAtk2 = PLAYERS[id].cAtk2 + 1
PLAYERS[id].cDef2 = PLAYERS[id].cDef2 - 7
PLAYERS[id].cSpd2 = PLAYERS[id].cSpd2 - 6
PLAYERS[id].class = 1
else
message(id, "You need to reset your class first!")
end
elseif button == 2 then
if PLAYERS[id].class == 0 then
PLAYERS[id].tmp.atk = PLAYERS[id].tmp.atk - 0.75
PLAYERS[id].tmp.def = PLAYERS[id].tmp.def + 3
PLAYERS[id].tmp.spd = PLAYERS[id].tmp.spd - 1
PLAYERS[id].cAtk2 = PLAYERS[id].cAtk2 - 0.75
PLAYERS[id].cDef2 = PLAYERS[id].cDef2 + 3
PLAYERS[id].cSpd2 = PLAYERS[id].cSpd2 - 1
PLAYERS[id].class = 2
else
message(id, "You need to reset your class first!")
end
elseif button == 3 then
if PLAYERS[id].class == 0 then
PLAYERS[id].tmp.atk = PLAYERS[id].tmp.atk + 0.25
PLAYERS[id].tmp.def = PLAYERS[id].tmp.def + 1
PLAYERS[id].tmp.spd = PLAYERS[id].tmp.spd + 1
PLAYERS[id].cAtk2 = PLAYERS[id].cAtk2 + 0.25
PLAYERS[id].cDef2 = PLAYERS[id].cDef2 + 1
PLAYERS[id].cSpd2 = PLAYERS[id].cSpd2 + 1
PLAYERS[id].class = 3
else
message(id, "You need to reset your class first!")
end
end
end
end
COFING > PLAYERINIT
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
PLAYERINIT = {
Experience = 0,
Level = 1,
Money = 50,
HP = 100,
MP = 100,
cAtk2 = 0,
cDef2 = 0,
cSpd = 0,
class = 0,
FISHLevel = 1,
FISHExp = 0,
Inventory = {},
Equipment = {},
Spawn = {784, 240},
Tutorial = {},
Info = {},
Experience = 0,
Level = 1,
Money = 50,
HP = 100,
MP = 100,
cAtk2 = 0,
cDef2 = 0,
cSpd = 0,
class = 0,
FISHLevel = 1,
FISHExp = 0,
Inventory = {},
Equipment = {},
Spawn = {784, 240},
Tutorial = {},
Info = {},
Funcions
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function updateEXTRAS(id)
hudtxt2(id, 18, PLAYERS[id].FISHLevel, '255255000', 250, 435, 2)
hudtxt2(id, 19, "Fishing", '255255255', 150, 435, 0)
if PLAYERS[id].class == 0 then
hudtxt2(id, 34, "Noobie", '255255000', 378, 421, 2)
hudtxt2(id, 35, "Class", '255255255', 278, 421, 0)
elseif PLAYERS[id].class == 1 then
hudtxt2(id, 34, "Fighter", '255255000', 378, 421, 2)
hudtxt2(id, 35, "Class", '255255255', 278, 421, 0)
elseif PLAYERS[id].class == 2 then
hudtxt2(id, 34, "Defender", '255255000', 378, 421, 2)
hudtxt2(id, 35, "Class", '255255255', 278, 421, 0)
elseif PLAYERS[id].class == 3 then
hudtxt2(id, 34, "Mage", '255255000', 378, 421, 2)
hudtxt2(id, 35, "Class", '255255255', 278, 421, 0)
end
end
hudtxt2(id, 18, PLAYERS[id].FISHLevel, '255255000', 250, 435, 2)
hudtxt2(id, 19, "Fishing", '255255255', 150, 435, 0)
if PLAYERS[id].class == 0 then
hudtxt2(id, 34, "Noobie", '255255000', 378, 421, 2)
hudtxt2(id, 35, "Class", '255255255', 278, 421, 0)
elseif PLAYERS[id].class == 1 then
hudtxt2(id, 34, "Fighter", '255255000', 378, 421, 2)
hudtxt2(id, 35, "Class", '255255255', 278, 421, 0)
elseif PLAYERS[id].class == 2 then
hudtxt2(id, 34, "Defender", '255255000', 378, 421, 2)
hudtxt2(id, 35, "Class", '255255255', 278, 421, 0)
elseif PLAYERS[id].class == 3 then
hudtxt2(id, 34, "Mage", '255255000', 378, 421, 2)
hudtxt2(id, 35, "Class", '255255255', 278, 421, 0)
end
end
AND
Code:
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("ms100","ms100")
function ms100()
for _,id in ipairs(player(0,"tableliving")) do
updateHUD(id)
updateEXTRAS(id)
end
end
function ms100()
for _,id in ipairs(player(0,"tableliving")) do
updateHUD(id)
updateEXTRAS(id)
end
end
HOOKS
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("join","EXPjoin")
function EXPjoin(id)
if loadplayer(id) then
print('-- loaded!')
else
print('-- unable to load!')
end
PLAYERS[id].tmp = {hp = 100, atk = 1, def = 1, spd = 0, usgn = player(id, "usgn"), equip = {}, exhaust = {}}
for k, v in ipairs(CONFIG.SLOTS) do
PLAYERS[id].tmp.equip[k] = {}
end
if PLAYERS[id].class > 0 then
PLAYERS[id].tmp.atk = PLAYERS[id].tmp.atk + PLAYERS[id].cAtk2
PLAYERS[id].tmp.def = PLAYERS[id].tmp.def + PLAYERS[id].cDef2
PLAYERS[id].tmp.spd = PLAYERS[id].tmp.spd + PLAYERS[id].cSpd2
end
end
function EXPjoin(id)
if loadplayer(id) then
print('-- loaded!')
else
print('-- unable to load!')
end
PLAYERS[id].tmp = {hp = 100, atk = 1, def = 1, spd = 0, usgn = player(id, "usgn"), equip = {}, exhaust = {}}
for k, v in ipairs(CONFIG.SLOTS) do
PLAYERS[id].tmp.equip[k] = {}
end
if PLAYERS[id].class > 0 then
PLAYERS[id].tmp.atk = PLAYERS[id].tmp.atk + PLAYERS[id].cAtk2
PLAYERS[id].tmp.def = PLAYERS[id].tmp.def + PLAYERS[id].cDef2
PLAYERS[id].tmp.spd = PLAYERS[id].tmp.spd + PLAYERS[id].cSpd2
end
end
PLSS HELPE ME
Is it just me or anyone else thinks the same?
The new cs2d update (0.1.2.2) ruined tibia. The bugs are back, you can use knife while wearing another weapon. I tryed to use Kenvo's fixed bug, but none of that worked
The new cs2d update (0.1.2.2) ruined tibia. The bugs are back, you can use knife while wearing another weapon. I tryed to use Kenvo's fixed bug, but none of that worked

@
eduxd0707:
line 12: PLAYERS[id].class = PLAYERS[id].class + 1
line 24: PLAYERS[id].class = PLAYERS[id].class + 2
line 36: PLAYERS[id].class = PLAYERS[id].class + 3
you edit and work
.

line 12: PLAYERS[id].class = PLAYERS[id].class + 1
line 24: PLAYERS[id].class = PLAYERS[id].class + 2
line 36: PLAYERS[id].class = PLAYERS[id].class + 3
you edit and work

My youtube Channel http://www.youtube.com/user/ufuk500
Does anyone get this error?
The Line of the code is:
Code:
1
LUA ERROR: sys/lua/cs2dtibia/functions.lua:353: attempt to index field '?' (a nil value)
The Line of the code is:
Code:
1
return TILEZONE[y][x]
Downloaded it, and can still shoot through walls, I tried changing the weapon range but all it did was decrease the range Dx
Then you're doing something wrong. Here is the code:
Replace your MONSTERattack with this in monsters.lua
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
addhook("attack", "MONSTERattack")
function MONSTERattack(id)
if gettile(PLAYERS[id].x, PLAYERS[id].y).SAFE or gettile(PLAYERS[id].x, PLAYERS[id].y).NOMONSTERS then
return
end
if inarray({400, 401, 402, 403, 404}, PLAYERS[id].Equipment[7]) then
msg2(id,"You are not allowed to attack on a horse.")
return
end
local weapon, closest = player(id, 'weapontype')
for _, m in ipairs(MONSTERS) do
local x, y = player(id, 'x'), player(id, 'y')
local dist = math.sqrt((m.x-x)^2+(m.y-y)^2)
if dist <= (closest and closest[2] or (CONFIG.WEAPONRANGE[weapon] or CONFIG.WEAPONRANGE[50])) then
local rot = player(id, 'rot')
if math.abs(math.rad(rot) - math.atan2(y-m.y, x-m.x) + math.pi/2)%(2*math.pi) <= (CONFIG.WEAPONWIDTH[weapon] or CONFIG.WEAPONRANGE[50]) then
if free_line(player(id,"x"),player(id,"y"),m.x,m.y) then
closest = {m, dist}
end
end
end
end
if closest then
closest[1]:damage(id, math.ceil(20*((PLAYERS[id].Level+50)*PLAYERS[id].tmp.atk/closest[1].def)/math.random(60, 140)), weapon)
end
end
function MONSTERattack(id)
if gettile(PLAYERS[id].x, PLAYERS[id].y).SAFE or gettile(PLAYERS[id].x, PLAYERS[id].y).NOMONSTERS then
return
end
if inarray({400, 401, 402, 403, 404}, PLAYERS[id].Equipment[7]) then
msg2(id,"You are not allowed to attack on a horse.")
return
end
local weapon, closest = player(id, 'weapontype')
for _, m in ipairs(MONSTERS) do
local x, y = player(id, 'x'), player(id, 'y')
local dist = math.sqrt((m.x-x)^2+(m.y-y)^2)
if dist <= (closest and closest[2] or (CONFIG.WEAPONRANGE[weapon] or CONFIG.WEAPONRANGE[50])) then
local rot = player(id, 'rot')
if math.abs(math.rad(rot) - math.atan2(y-m.y, x-m.x) + math.pi/2)%(2*math.pi) <= (CONFIG.WEAPONWIDTH[weapon] or CONFIG.WEAPONRANGE[50]) then
if free_line(player(id,"x"),player(id,"y"),m.x,m.y) then
closest = {m, dist}
end
end
end
end
if closest then
closest[1]:damage(id, math.ceil(20*((PLAYERS[id].Level+50)*PLAYERS[id].tmp.atk/closest[1].def)/math.random(60, 140)), weapon)
end
end
Replace your MONSTERattack with this in monsters.lua
Then you probably removed or added something where you shouldn't have. Best for you to download KenVo's script and replace everything and put your item, npc and monster tables back.
I made a new clean cs2d put tibia and KenVo's, but still doesn't work. I've also heard some other users saying that shoot through walls wasn't fixed in KenVo's files at all. Without the code you gave me, I can shoot them through walls but with the code, it makes them go god mode and can't shoot them with/without walls >_<
edit: Here is the error:
edit: Here is the error:
Code:
1
LUA ERROR: sys/lua/cs2dtibia/monsters.lua:392: attempt to call global 'free_line' (a nil value)
edited 1×, last 03.04.15 10:20:19 am
Add this to functions.lua
Code:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
function free_line(x1,y1,x2,y2)
for i=1,distance(x1,y1,x2,y2) do
if tile(math.floor((x1+i*math.cos(math.atan2(y2-y1,x2-x1)))/32),math.floor((y1+i*math.sin(math.atan2(y2-y1,x2-x1)))/32),"walkable")==false then
return false
end
end
return true
end
function distance(x1,y1,x2,y2)
return math.floor(math.sqrt(math.pow(x1-x2,2)+math.pow(y1-y2,2)))
end
for i=1,distance(x1,y1,x2,y2) do
if tile(math.floor((x1+i*math.cos(math.atan2(y2-y1,x2-x1)))/32),math.floor((y1+i*math.sin(math.atan2(y2-y1,x2-x1)))/32),"walkable")==false then
return false
end
end
return true
end
function distance(x1,y1,x2,y2)
return math.floor(math.sqrt(math.pow(x1-x2,2)+math.pow(y1-y2,2)))
end
Hallo, I'm back again with another request.
Is it possible to make something like a faction/clan/party system wherein you can't kill each other if you are in the same thing. You talk to an npc, you pay some money to create a faction, and it tells you the maximum players you can recruit. It doesn't need to have clan points, honor or something, I just want their faction name they're in to be seen in their HUD and if possible some rank powers.
Thanks!
Is it possible to make something like a faction/clan/party system wherein you can't kill each other if you are in the same thing. You talk to an npc, you pay some money to create a faction, and it tells you the maximum players you can recruit. It doesn't need to have clan points, honor or something, I just want their faction name they're in to be seen in their HUD and if possible some rank powers.
Thanks!