Generally I just want to ask if anyone here knows a lot about entities, but I'm sure people will say a lot about that. I myself do not know entities very well, but I will soon have to learn either way. I know server side more then all the other fun stuff. Though, if anyone can assist me with these two things, so I have a better understanding exactly how I want to proceed on my idea, that would be great.
First off I want to be able to press the use key, and then words pop up on said entity saying who owns it. I got as far as to tell me who owns it, but my issue is I don't recall a way to show it up on screen who owns it.
function ENT:Use( ply, ply2 )
if SERVER then
if ply:IsPlayer() == true then
local findplayer = nil
for k, v in pairs(player.GetAll()) do
if v == self:GetNWEntity( "owner" ) then
findplayer = v
end
end
if findplayer != nil then
MsgN(findplayer:Name())
else
MsgN("World")
end
end
end
end
Now the second to last request is I have no clue how to do. I want to be able to hit entity (which is going to be square/rectangle) and where ever I hit it, it makes a small black line at it. I will draw this out on photoshop to show you exactly what I mean.
This is our tree/square
Meet Mr. Crowbar
Mr. Crowbar smacks the tree at said location making a black line all the way through it. This black line is only relative to the amount of damage mr. crowbar did to that object as a whole
As damage increases, and the health decreases as an entire entity, the line gets bigger before reaching 0
Tree them falls apart, becoming two entites
I'm now realizing how difficult this request is becoming.