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 2 317 18 Next To the start

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

KenVo
User Off Offline

Quote
==admin.lua==
Alright. First put this:
1
2
3
4
5
6
7
8
9
elseif command =='g' then
	if PLAYERS[id].tmp.god ~= 1 then
		PLAYERS[id].tmp.god = 1
		msg2(id,'God mode on')
	else
		PLAYERS[id].tmp.god = 0
		msg2(id,'God mode off')
	end
	return 1

Under "return 1" in admin.lua around at line 182
1
2
3
4
elseif command =='v' then
	saveserver()
	msg2(id,'Saved server!')
	return 1

==hooks.lua==
Put this:
1
, god = 0

in: ( line 8 )
1
PLAYERS[id].tmp = {hp = 100, atk = 1, def = 1, spd = 0, usgn = player(id, "usgn"), equip = {}, exhaust = {}}


and this:
1
if PLAYERS[id].tmp.god == 1 then return 1 end

under:
1
2
addhook("hit","EXPhit")
function EXPhit(id,source,weapon,hpdmg,apdmg)

==monsters.lua==
Put this:
1
if PLAYERS[id].tmp.god == 1 then return end

Under:
1
function Monster:hit(id, dmg)


√ Use !g in game to get god mode

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

KenVo
User Off Offline

Quote
==npcs.lua==
1
[18] = {"Reset level", pos={464,560}, rot=0, image="npc3"},
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
NPCs[18].func = function(npc, id, words, state)
	if words == "hi" then
		NPCspeak(npc, "Greetings! Say 'reset' if you need to reset your level for $10000.")
		PLAYERS[id].tmp.npcstate = {npc, 1}
	elseif contains(words, "bye") then
		NPCspeak(npc, "Goodbye.")
		PLAYERS[id].tmp.npcstate = nil
	elseif state == 1 then
		if contains(words, "reset") then
			NPCspeak(npc, "Please un-equip your items then say 'yes'.")
			PLAYERS[id].tmp.npcstate = {npc, 2}     
		end
	elseif state == 2 then
		if contains(words, "yes") then
			if  PLAYERS[id].Level >= 50 then
				addmoney(id, 10000)
				message(id, "You have gained $10000.", "255255255")
				PLAYERS[id].Equipment={}
				PLAYERS[id].tmp = {hp = 100, atk = 1, def = 1, spd = 0, usgn = player(id, "usgn"), equip = {}, exhaust = {}}
				PLAYERS[id].Level = 1
				PLAYERS[id].Experience = 1
				updateEQ(id, newitems, previtems)
				updateHUD(id)
				NPCspeak(npc, "Enjoy! Re-join after you reset your level.")
				PLAYERS[id].tmp.npcstate = nil
			else
				NPCspeak(npc, "You need to be level 50!")
				PLAYERS[id].tmp.npcstate = nil
			end
		elseif contains(words, "no") then
			NPCspeak(npc, "Alright then.")
			PLAYERS[id].tmp.npcstate = nil
		end
	end
end

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

KenVo
User Off Offline

Quote
user Fossil has written
Hey dude all these new function commands are great! I've got one last favor to ask.. how can I add this script: file File does not exist (7827) to the tibia script?


A challenge for you: Remove the serveraction hook and create a command that turn on/off PK I will make this script and show you how to do that eventually

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

Bobakrome
User Off Offline

Quote
user Kantos has written
just find if choose == 1 then then chanche it with 3 then server.lua add pk.lua and press f4 to open it


Why not better to use an
1
if text == !pkmode
I think that should help -.-


PS - I'm at school so don't pm jsut after 4 hours i think

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

KenVo
User Off Offline

Quote
user Glix has written
How i can add new stats i mean
1
STATS = {'Experience', 'Level', 'Money', '..new..'},
After this where i need to add what stats does?


Try to add 'Mana' in that table, then see what happens. Also, you only can add the initial stats in PLAYERINIT = {} in configs.lua or else it won't work unless you delete all your players.lua saves because when someone join a game, only stuffs that been made in PLAYERINIT={} are saved to players.lua.
To the start Previous 1 2 317 18 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview