Jump to content

Recommended Posts

Hello, i made a script that plays winning.mp3 and shows a message in chat after a player killed another player

but i dont know if this will work - will this work ?

 

function wasted (killer, weapon, bodypart)
    local killer = attacker() 
    local sound = playSound("sounds/winning.mp3")
    local message = outputChatBox ( #006600• #ffffff"..getPlayerName ( attacker ).." #006600is dangerous!" )
    setSoundVolume(sound, 0.5)
end

addEventHandler("onClientPlayerWasted", localPlayer, wasted)

Edited by Karoleq2
Link to comment
Quote

 local message = outputChatBox ( #006600• #ffffff"..getPlayerName ( attacker ).." #006600is dangerous!" )

You dont need that.

 

function wasted (killer, weapon, bodypart) -- Input the name of the function
    local sound = playSound("sounds/winning.mp3") -- Play wasted.mp3 from the sounds folder
    setSoundVolume(sound, 1.0) -- set the sound volume to 100%
    outputChatBox ( #006600 #ffffff"..getPlayerName ( attacker ).." #006600is dangerous!"root,255,255,255,true)
end
 
addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted)

 Try this

Edited by TheMOG
forgot something
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...