I'm pretty new at scripting. And have a question about generating a talking weapon. When I say pretty new. I mean : I don't have to faintest idea how to start
I want to create a weapon that talks to the player when it is equiped. Do I use a onequiphook?
And what kind of script would I make (and where to place it) to get the talking part completly random (every once in a while)
Can u guys get me started with an example ? ... I would love to puzzel with it myself if I get a head start
I think.. you could use the onEquip hook to activate a timer with a lengthy interval that activates a random phrase script. You could use the onUnequip hook to deactivate the timer.
You would probably want to put all the phrases into a big table talkTable = { }, then whenever the timer fires off have the script pull a random table element and hudPrint it
hudPrint(talkTable[math.random(1,#talkTable)])
maybe that extra comma at the end of the table line is causing the problem. Also, if the table isn't going to change, you might want to put it outside the function, like right before it, so it gets defined at map start.