Jump to content

voicecommands?


xTravax

Recommended Posts

i don't know to script but i tried to edit wiki script is it good?

-- it was stopSound so i changed it to startSound

function startMySound() 
    sound = playSound( "sound.mp3", true ) 
end 
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), startMySound ) 
addCommandHandler ( "startsound", startMySound )  

Link to comment
function startMySound() 
    sound = playSound( "hello.mp3", false ) 
end 
addCommandHandler ( "hello", startMySound ) 

i have made mistake in META now its FIXED

but i have another PROBLEM

when i do /hello it will keep repeating without stopping and i want it to stop when it finishes (2 seconds)

Link to comment
function startMySound() 
    sound = playSound( "hello.mp3", false ) 
end 
addCommandHandler ( "hello", startMySound ) 

i have made mistake in META now its FIXED

but i have another PROBLEM

when i do /hello it will keep repeating without stopping and i want it to stop when it finishes (2 seconds)

setTimer 
destroyElement 

Link to comment

i tried to make it but it looks all weird and if i give it to you it would look like i never saw lua and i know to make

function startMySound()

sound = playSound( "hello.mp3", false )

end

addCommandHandler ( "hello", startMySound )

but idk to make destroyelement and settimer

Link to comment

It shouldn't repeat since the loop argument is false, but I guess your mp3 file isn't just a one "hello".

function startMySound() 
helloSound = playSound( "hello.mp3", false ) 
setTimer(stopHelloSound, 2000, 1) 
end 
addCommandHandler ( "hello", startMySound ) 
  
function stopHelloSound() 
stopSound(helloSound) 
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...