Try.
local x,y = guiGetScreenSize( )
function headshot ( killer, weapon, bodypart )
if ( killer ) and ( killer ~= source ) then
local image = guiCreateStaticImage ( x/5, y/5.8, 399,169, "SAMP"..tostring( math.random( 1,4 ) )..".png", false )
guiStaticImageLoadImage( image, "SAMP"..tostring( math.random( 1,4 ) )..".png" )
setTimer ( guiSetVisible, 4000, 1, image, false )
end
end
addEventHandler ( "onClientPlayerWasted", localPlayer, headshot )
You forgot 'end'.