[HELP]Timer sound

Started by Alecu Madalin, Jul 30, 2019, 09:15 PM

Previous topic - Next topic

Alecu Madalin

hey guys can someone help me with the timer
im trying to make a timer for sound 50010 for 1 sec but it does nothing

this is my sound script

NewTimer("player.PlaySound", 1000, 1);
player.PlaySound(50010);

seems my script is wrong

KrOoB_

you can edit your sound and you can make it 1second you don't have to script it

DizzasTeR

Quote from: KrooB on Jul 31, 2019, 12:48 AMyou can edit your sound and you can make it 1second you don't have to script it

Bad advice.


On the topic note, you are using the timer wrong, you have to provide a function to the time in the first param.

function PlaySoundForPlayer(playerID, soundID) {
    local player = FindPlayer(playerID);
    if(!player) return;
    player.PlaySound(soundID);
}

NewTimer("PlaySoundForPlayer", 1000, 1, player.ID, sound_id);

Alecu Madalin

Quote from: Doom_Kill3R on Jul 31, 2019, 05:27 AM
Quote from: KrooB on Jul 31, 2019, 12:48 AMyou can edit your sound and you can make it 1second you don't have to script it

Bad advice.


On the topic note, you are using the timer wrong, you have to provide a function to the time in the first param.

function PlaySoundForPlayer(playerID, soundID) {
    local player = FindPlayer(playerID);
    if(!player) return;
    player.PlaySound(soundID);
}

NewTimer("PlaySoundForPlayer", 1000, 1, player.ID, sound_id);

Thank you very much for helping me out for the sound timer btw it works :D 8)
Im going to mark this topic as solved

KrOoB_

Quote from: Doom_Kill3R on Jul 31, 2019, 05:27 AM
Quote from: KrooB on Jul 31, 2019, 12:48 AMyou can edit your sound and you can make it 1second you don't have to script it
Bad advice.

as u wish but it's same thing ;D ;D