English [REQ]NPC Health Left[tibia]

34 replies
Goto Page
To the start Previous 1 2 Next To the start
03.01.13 01:53:41 pm
Up
Infinite Rain
Reviewer
Offline Off
Use parse function instead, lol
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
03.01.13 02:00:44 pm
Up
connor34
User
Offline Off
@user Infinite Rain: 1 more thing, can you tell me how I can make my Health Sytem like this:

IMG:http://i45.tinypic.com/23j4ej9.jpg


It got 100 and not normal..
03.01.13 02:03:20 pm
Up
EndDead
User
Offline Off
@user connor34: This is just a HUD picture (or w/e its called) with the texts moved.
And about the health...
Code:
1
Player(id,"health")

Hope you get it.
03.01.13 02:04:35 pm
Up
connor34
User
Offline Off
Code:
1
2
hudtxt2(id,41, 'Dealt '..dmg..' damage, '..self.health..' health left.', '255255255', 200,250,0)
hudtxtalphafade(id,41,5000,0)


This still doesn't work Factis. I made it to parse function. Everytime I hit the msg wont dissapear and the monster wont die >.<
edited 1×, last 03.01.13 03:50:22 pm
03.01.13 04:04:58 pm
Up
EndDead
User
Offline Off
@user connor34: This thread is not for tibia questions. ask in the other thread.

About the health script:

Since tibia uses PLAYERS[id].HP ...
Code:
1
hudtxt2(id,27, PLAYERS[id].hp, '255255000', 402,407,1) -- Change 402 and 407 to the position on screen

Open Functions.lua , find:
Code:
1
function updateHUD(id)

Paste the script below it or anywhere that would work.

UNTESTED

PS: you may need to change PLAYERS[id].HP to PLAYERS[id].tmp.HP

(This was sent as a message to you via PM, But posted here for others to see)
03.01.13 04:15:31 pm
Up
Yates
Reviewer
Offline Off
@user connor34: Make sure it look exactly like this;

IMG:http://i.imgur.com/FqrE1.png


And please post in this thread whenever you need help; thread cs2d Tibia Requests - If Jynxxx does not help you then others will.
03.01.13 05:11:22 pm
Up
NutShell
User
Offline Off
Code:
1
msg2(id,"You have dealt "..dmg.."damage, the monster has "..self.health.."healt left.")

Not Work This Fucking Code!!
No annoying animated sigs please. /DC
03.01.13 05:16:07 pm
Up
Yates
Reviewer
Offline Off
Oh, right. It does not work according to you yet I am using this code on a server, herp derp..

Either show me YOUR code or stop saying that something does not work and think that we can magically change it or even know what is wrong.
13.01.13 07:15:59 pm
Up
mattasha
User
Offline Off
@user NutShell:

Me too i HAD that's Problem So i just Search In the Lua
And i Had the Problem So

Use this it will Work 100%
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
function Monster:damage(id, dmg, wpntype)
     if not PLAYERS[id].Tutorial.damagem then
          message(id, "You have attacked a monster! Good job! Keep on attacking it until it dies.", "255128000")
          PLAYERS[id].Tutorial.damagem = true
     end
     local wpnName
     if wpntype == 251 then
          wpnName = 'rune'
     elseif wpntype == 46 then
          wpnName = 'firewave'
          dmg = dmg/5
     else
          wpnName = PLAYERS[id].Equipment[3] and ITEMS[PLAYERS[id].Equipment[3]].name or 'dagger'
     end
     self.health = self.health - dmg
     hudtxt2(id,41, 'Dealt '..dmg..' damage, '..self.health..' health left.', '255255255', 200,250,0)
     print(player(id, 'name') .. ' deals ' .. dmg .. ' damage to ' .. self.name .. ' usng a ' .. wpnName .. '.')
     if self.health <= 0 then
          if not PLAYERS[id].Tutorial.killm then
               message(id, "Congratulation! You have killed your first monster. You can proceed to pick up the loot by using the drop weapon button (default G)", "255128000")
               PLAYERS[id].Tutorial.killm = true
          end
          addexp(id, math.floor(self.exp*CONFIG.EXPRATE))
          self:die()
     else
          parse('effect "colorsmoke" ' .. self.x .. ' ' .. self.y .. ' 0 ' .. self.scaley .. ' ' .. (self.r and (self.r .. ' ' .. self.g .. ' ' .. self.b) or '192 0 0'))
     end
     radiussound("weapons/machete_hit.wav", self.x, self.y)
     return true
end


I Wish You happy New year And enjoy!



And Please can someone can HELP me for "How to set monsters's Position in weiwen tibia script"

Help me please
16.01.13 06:47:28 pm
Up
Nixo
User
Offline Off
ahh
edited 1×, last 09.01.14 03:22:53 pm
Nah
06.07.13 08:14:26 pm
Up
DryDay
User
Offline Off
@mattscha how i can make that it dissapear after 1 min or so.
16.02.14 05:32:00 pm
Up
Tudi20
User
Offline Off
@user DryDay:
I tried this to paste in...
Code:
1
2
hudtxt2(id, 41, 'Monster: ' .. self.name .. ' | Dmg: ' .. dmg .. ' | HP: ' .. self.health, '255255255', 200,250,0)
hudtxtalphafade(id, 41, 5000, 1)

...but I got this error:
IMG:http://i.imgur.com/vzPf9g4.png

• Don't think about what windows is it or what mean the "CS2d szerver futtatása"!
× Somebody can help?
16.02.14 08:48:15 pm
Up
Marcell
Super User
Offline Off
Its a hungarian phrase lol
Meaning: running cs2d server
16.02.14 09:02:35 pm
Up
Avo
User
Offline Off
@user Tudi20: It means that function which doesn't exist is called. Check if you declared function "hudtxtalphafade".
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
17.02.14 06:17:43 am
Up
MikuAuahDark
User
Offline Off
and the most simplest way to fix it by placing this code at top of server.lua

Code:
1
2
3
4
_map=map
dofile'sys/lua/wrapper.lua'     -- make sure that your wrapper.lua isn't modified by tibia, some tibia edit and provide it's own wrapper.lua
map=_map
_map=nil
file cs2d LuaJIT for Dedicated Server (11) JIT POWER! | Know your Lua errors! | Draw stuff at Pixelize Art --xx-- server!
To the start Previous 1 2 Next To the start