Jump to content

random player script help


TmM_DEVIL

Recommended Posts

i have the manhunt script started need some help with on player wasted chose a new random player with blip and wanted stars

here is code i using to do them things

function lamahunt ( player, command ) 
  
        local Player = getRandomPlayer ( ) 
        local myBlip = createBlipAttachedTo ( Player, 23 ) 
        setPlayerWantedLevel ( Player, 6 )  
    outputChatBox("your the lama run!") 
  
end 
        function playerDied( killer, killerWeapon, bodypart) 
        outputChatBox(getClientName(source).." The Lama died!") 
end 
  
addEventHandler ( "onPlayerWasted", getRootElement(), playerDied ) 
addCommandHandler ( "lama", lamahunt ) 
  

thanks

Link to comment

If you want it to choose the new random player when the one dies shouldn't it be

  
function lamahunt ( player, command ) 
  
        local Player = getRandomPlayer ( ) 
        local myBlip = createBlipAttachedTo ( Player, 23 ) 
        setPlayerWantedLevel ( Player, 6 ) 
    outputChatBox( "You're the lama run!" , Player ) 
  
end 
function playerDied( killer, killerWeapon, bodypart) 
        outputChatBox(getClientName(source).." The Lama died!") 
end 
  
addEventHandler ( "onPlayerWasted", getRootElement(), lamahunt ) 
addEventHandler ( "onPlayerWasted", getRootElement(), playerDied ) 
  
  

but I'm not sure about that.

Altho, with the event onPlayerWasted attached to getRootElement() wouldn't it say the message and choose another player when anyone dies?

you have to make it so it only changes when the lama dies = /

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...