yea thx.
I have to work then with GetNWInt and SetNWInt right??
That agree would be a yes :P
Edit:
Or usermessages but i'm not sure which one would be faster.
Edited:
If you need help on a script:
Edit: Changed font
if CLIENT then
function DrawHPInfo()
local ply = LocalPlayer()
local tr = ply:GetEyeTrace()
if tr.HitWorld or not tr.Hit then return end
local NPCHP = LocalPlayer():GetNWInt("NPCHealth")
local NPCMaxHP = LocalPlayer():GetNWInt("NPCMaxHealth")
local NPCPos = tr.Entity:GetPos()
local NPCMaxs = tr.Entity:OBBMaxs()
NPCPos.z = NPCPos.z + NPCMaxs.z + 2.5
local NPCPosToScr = NPCPos:ToScreen()
local TxtLen = surface.GetTextSize(NPCHP.."/"..NPCMaxHP)
draw.SimpleTextOutlined(NPCHP.."/"..NPCMaxHP, "Trebuchet22", NPCPosToScr.x + (TxtLen/2), NPCPosToScr.y, Color(0,0,0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM, 1, Color(255,255,255,150))
end
hook.Add("HUDPaint", "DrawMaxHP", DrawHPInfo)
else
AddCSLuaFile("healthmod.lua")
function SendHPInfo()
for k,v in ipairs(player.GetAll()) do
local tr = v:GetEyeTrace()
if tr.HitWorld or not tr.Hit then return end
if tr.Entity:IsNPC() then
v:SetNWInt("NPCHealth", tr.Entity:Health())
v:SetNWInt("NPCMaxHealth", tr.Entity:GetMaxHealth())
end
end
end
hook.Add("Think", "FindMaxHP", SendHPInfo)
end