Forum

> > CS2D > Scripts > Lua! RPG Tibia armor function.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua! RPG Tibia armor function.

3 replies
To the start Previous 1 Next To the start

old Lua! RPG Tibia armor function.

gear
User Off Offline

Quote
I can seem to get my armor function work, this is probably a easy problem to solve, but lets face it; Im a noob when it comes to LUA. So maybe you guys can help me.
What im trying to do is create a function that allows the armor to heal you when you select cast in the menu (there would be equip and cast). Here is the code I have so far
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[700] = {
		name = "Divine Armor", 
		r = 255, g = 255, b = 255, 
		action = {"cast","equip"}, 
		slot = 2,
		eimage = "gfx/weiwen/rpgxserv/redknightarmor.png",  
		fimage = "gfx/weiwen/rpgxserv/blueknightarmor.png",
		def = 3, 
		speed = 3, 
		func = {function(id,itemslot,itemid,equip)
		radiusmsg(player(id,"name") .. " Is healed by the power of divine !", player(id,"x"), player(id,"y"))
		explosion(player(id, "x"), player(id,"y"), 32, -50, id)
		local pos = player(id,"x") .. " " .. player(id,"y")
		parse("effect \"colorsmoke\" " .. pos .. " 5 5 128 255 255")
		radiussound("materials/glass2.wav", player(id,"x"), player(id,"y"))
		end, 
		},

Would be great if you could show me other functions with armor too!

-Heal over time while equipped

-Add HP when equipped, and remove HP when removed. (basicly when its equipped you more more HP, and when you remove it, the players HP goes back to normal)

Thanks guys!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview