Forum

> > CS2D > Scripts > Tibia script thread (Post tibia requests here)
Forums overviewCS2D overview Scripts overviewLog in to reply

English Tibia script thread (Post tibia requests here)

347 replies
Page
To the start Previous 1 212 13 1417 18 Next To the start

old Re: Tibia script thread (Post tibia requests here)

Conscience
User Off Offline

Quote
@user KenVo: Is it possible to link two servers together without changing the save function? I don't think two servers can run the same Lua file while it gets updated.

And if it's not possible. Would you be so kind and make it so for me? I would be very grateful.

Thanks in advance.

old Re: Tibia script thread (Post tibia requests here)

KenVo
User Off Offline

Quote
I'm not too sure about that because I've never thought about or tried it. But I think you can link 2 servers saves together and run at the same time, yes. However, the map saves and house saves need to be separated. The only save function we need to change is the player saving function; probably have to save individual players everytime he/she leaves the server.
I'm trying it after I get home from school and don't think it should be hard to make.

P.S. I removed the housing system in my edit because it causes lags and buggy sometimes and added a bank system instead.
edited 1×, last 05.04.13 07:57:43 pm

old speed

TopNotch
User Off Offline

Quote
Hello,
I added a horse with 20 speed.
But when I start the server, and ride that horse. My speed is still 0.
How to fix that?

old Re: Tibia script thread (Post tibia requests here)

KenVo
User Off Offline

Quote
Replace your updateEQ function in functions.lua with this
Spoiler >


This also fixes hp bug when you equip items (current hp goes back to max hp) and knife bug (you receive a knife when you equip other weapons like crossbow)

old Hello

-FQ
User Off Offline

Quote
can you show how to make fishing system? I think too much peoples wanna know how to make that.

old Re: Tibia script thread (Post tibia requests here)

KenVo
User Off Offline

Quote
There might be some bugs so tell me if you find any.

config.lua

Add this code to the CONFIG table
1
2
--minutes delay until dropped items are automatically remove from the map (except items in houses)
	CLEANITEMSDELAY= 5,

functions.lua

1. Under function updateTileItems(x,y), find local heightoffset. Add this code under it:

1
2
local heightoffset = (height < MAXHEIGHT and height or MAXHEIGHT)*3
		item[4] = CONFIG.CLEANITEMSDELAY --this code

2. Add this function to functions.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
25
26
27
28
29
30
31
function cleanitems()
	for k,v in pairs (GROUNDITEMS) do
		local x,y,height
		for a,b in pairs (v) do
			for c,d in pairs (b) do
				d[4] = d[4] -1
				y=k
				x=a
				height=c
				if d[4] <= 0 and not TILEZONE[y][x].HOUSE then
					local item = d
					if item[1] == 1337 then
						if item[2] then freeimage(item[2]) end
						GROUNDITEMS[y][x][height] = nil
					else
						local tile = gettile(x*32, y*32)
						if tile.HEAL and ITEMS[item[1]].heal then
							tile.HEAL = tile.HEAL - ITEMS[item[1]].heal
							if tile.HEAL == 0 then
								tile.HEAL = nil
							end
						end
						if item[2] then freeimage(item[2]) end
						GROUNDITEMS[y][x][height] = nil
					end
				end
			end
		end
	end
	
end

hooks.lua
Find function EXPminute(). Add cleanitems() under it.

1
2
3
4
5
6
7
8
addhook("minute","EXPminute")
function EXPminute()
	cleanitems()
	MINUTES = MINUTES+1
	if game'sv_password' == '' and MINUTES%5 == 0 then
		saveserver()
	end
end

old Re: Tibia script thread (Post tibia requests here)

SilentDash
User Off Offline

Quote
Can someone fix this Lua Error?
Spoiler >


line 213 >


whole function >


Problem solved
edited 1×, last 15.04.13 03:31:02 pm

old Re: Tibia script thread (Post tibia requests here)

Jarates
User Off Offline

Quote
Please fix this error: LUA ERROR: sys/lua/cs2dtibia/hooks.lua:329: attempt to index field '?' (a nil value)
Spoiler >
Line 329 =
1
if 	PLAYERS[id].tmp.equip[3].monstermessage >= 35 then
To the start Previous 1 212 13 1417 18 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview