❓ killmarker not hitmarker [LUA]

Posts 1–7 of 7 · Page 1 of 1
❓ killmarker not hitmarker [LUA]
i used game listen entity_killed didnt solve the problem im new on this can you guys do this for me please i just wanted to see
Code:
local drawkilltime = 0
gameevent.Listen("entity_killed") --We want to listen to the event if any entities die.
hook.Add("entity_killed", "killmarker",function(data)
	local victim = Entity(data.entindex_killed)
	local attacker = Entity(data.entindex_attacker)
	if !IsValid(victim) || !IsValid(attacker) then return end --Always check if they entities are there.
	if attacker == LocalPlayer() && victim:IsPlayer() then 
		drawkilltime = CurTime()+1 --Draw the marker for 1 second
	end
end)

hook.Add("HUDPaint", "DrawKillmarker",function())
	if drawkilltime >= CurTime() then
		--Draw killmarker here
	end
end
thanks that was very usefull for me
im trying to add this line but i fail everytime can you help

Code:
        sound.PlayFile("killmarker.wav", "mono", function()
Quote Originally Posted by bloodstain97 View Post
im trying to add this line but i fail everytime can you help

Code:
        sound.PlayFile("killmarker.wav", "mono", function()
Code:
sound.PlayFile( "killmarker.wav", "", function( station )
	if ( IsValid( station ) ) then station:Play() end --Check if the sound exists and can play if not don't do anything.
end )
thanks but im trying to tell when i kill player killmarker.wav play


edit: oh ok

Code:
surface.PlaySound("killmarker.wav")

i add this and problem solved
Thanks guessjoe1. I normally code in C, but i am getting into .lua now.
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us