Ahmed Ly Posted March 16, 2016 Posted March 16, 2016 client GUIEditor = { label = {}, } GUIEditor.label[1] = guiCreateLabel(288, 306, 158, 45, "Head_Shot + 5", false) local font_0 = guiCreateFont("Dragon.ttf",13) guiSetFont(GUIEditor.label[1], font_0) guiLabelSetColor(GUIEditor.label[1], 24, 49, 230) guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) guiSetVisible(GUIEditor.label[1],false) function head() playSound("HeadShot.mp3") guiSetVisible(GUIEditor.label[1],true) setTimer(closewin, 3000, 1) end addEvent("text", true) addEventHandler("text", getRootElement(), head) function closewin() guiSetVisible(GUIEditor.label[1],false) end server addEventHandler("onPlayerWasted",root, function ( _,attacker ) if (attacker and attacker ~= source and isElement(attacker)) and bodypart == 9 ) then exports["topbarchat"]:sendClientMessage ( "[server-Dragon] Head Shot",attacker, 0, 255, 0 ) triggerClientEvent(attacker,"text",attacker) end end )
Ahmed Ly Posted March 16, 2016 Author Posted March 16, 2016 Where is the problem? Problem is bodypart == 9
Dimos7 Posted March 16, 2016 Posted March 16, 2016 addEventHandler("onPlayerWasted", root function(attacker, weapon, ammo, bodypart) if (attacker and attacker ~= source and isElement(attacker) and bodypart == 9) then exports["topbarchat"]:sendClientMessage("[server-Dragon] Head Shot", attacker, 0, 255, 0) triggerClientEvent(attacker , "text", attacker) end end)
Ahmed Ly Posted March 16, 2016 Author Posted March 16, 2016 addEventHandler("onPlayerWasted", root function(attacker, weapon, ammo, bodypart) if (attacker and attacker ~= source and isElement(attacker) and bodypart == 9) then exports["topbarchat"]:sendClientMessage("[server-Dragon] Head Shot", attacker, 0, 255, 0) triggerClientEvent(attacker , "text", attacker) end end) not work
Dimos7 Posted March 16, 2016 Posted March 16, 2016 addEventHandler("onPlayerWasted", root, function(attacker, weapon, ammo, bodypart) if (attacker and attacker ~= source and isElement(attacker) and getElementType(attacker) == "player" and bodypart == 9 )then exports["topbarchat"]:sendClientMessage("[server-Dragon] Head shot", attacker, 0, 255, 0) triggerClientEvent(attacker, "text", attacker) end end)
swedishboy Posted March 16, 2016 Posted March 16, 2016 try this addEventHandler("onPlayerDamage", root, function(attacker, attackerweapon, bodypart) if bodypart == 9 then killPlayer ( source ) exports["topbarchat"]:sendClientMessage("[server Dragon] Head shot", attacker, 0, 255, 0) triggerClientEvent(attacker, "text", attacker) end end)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now