Jump to content

can get Some help over here!


E-mail

Recommended Posts

Hi iam Making a resource

see if last Player in round then

Player sound you are the last men in round Congratulations

see my code and Fix Please

function DestructionMoney2() 
local alivePlayers = getAlivePlayers() 
   if #alivePlayers == 1 then  
   local playername = getPlayerName(alivePlayers[1]) 
  local serial = getPlayerSerial(alivePlayers[1]) 
local sound = playSound("sounds/lastmen.mp3") 
    setSoundVolume(sound, 0.5) 
end 
  

:wink:

Link to comment

I don't have an idea will that work ( not tested ) .

local playername = getPlayerName(alivePlayers[1]) 
local sound = playSound("sounds/lastmen.mp3") 
local alivePlayers = getAlivePlayers() 
  
function DestructionMoney2() 
    if #alivePlayers == 1 then 
    sound = playSound("sounds/lastmen.mp3") 
    end 
end 

Edited by Guest
Link to comment

-- server side

function DestructionMoney2() 
local alivePlayers = getAlivePlayers() 
   if #alivePlayers == 1 then 
     local playername = getPlayerName(alivePlayers[1]) 
     local serial = getPlayerSerial(alivePlayers[1]) 
     triggerClientEvent(alivePlayers[1],"playTheSound",alivePlayers[1]) 
     end 
end 

-- client side

addEvent("playTheSound",true) 
addEventHandler("playTheSound",root, 
function () 
    local sound = playSound("sounds/lastmen.mp3") 
    setSoundVolume(sound, 0.5) 
end) 

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