Gmod - Receive points (pointshop) for taunting! Help :(

Hey there, so.. I have a prop hunt server that im configuring for like 5 days, and I already have everything I want and how I want, and I'm happy with it, but there's still one thing to do that I can't figure out how to do it.. I already found solutions, but didn't work, and some where configured to random taunts, but my server has a menu with a bunch of taunts and you can select which one to play, and well, I would like props to receive points for taunting and ofc different points for different taunts, according to their duration.. for example, if someone used a taunt with 1 sec duration, would receive 1 point, but if someone used a taunt with 20 sec duration would receive 15 points.. etc.. Please.. Can someone help me? :(

The only thing I know is (atleast I think) the code has to have these?

local pspoints = math.ceil(SoundDuration("sound/musicname.mp3") * pointmult)
ply:PS_GivePoints(pspoints)

ofc it's not completed, and I don't even know if these are really correct.. so yeah.. can someone help me? :(

I wish I could help, but I don't know lua :(

Wouldn't It Be Easier just to add the give points command to the play sound part of the taunt menu. So when they okay the taunt it does the play sound command as well as give the amount of points wanted for each Press.This should save you from unneeded extra code and help against people just spamming the button for points.

it doesn't work, because the config of the taunt menu, I can't add that, otherwise it gets broken, and the menu of taunts doesn't show any taunt :/ because in that lua file, you can only put something like this

addTaunt("Cant Touch This", {
"taunts/canttouchthis11.mp3"
}, "props", nil, {"medium"}, 11)

where is the tittle, then the dir of the sound, then the team, then the voice (male or female, in this case its custom so no voice, thats why the nil), and then the category that is medium, which creates the list "medium" with all the sounds "medium duration" and then 11 that is the duration.. can't add anything more to that :/

If you have point shop, where ever your taunts are being handled add the line PS_GivePoints(points)

Where the bold points is an integer value for the points. With the lockout (that stops the player from re-taunting whilst one is already playing) just use that value as the point value (1sec = 1 point, 20sec = 20points)

I realized what you wanted to say, kinda, but the idea itself, not that much about the points? What will that "points" value do specifically? Can you explain a lil better? :/

I think I have a fix. Any chance I could get your code and try to fix it in my spare time? I believe I just need to get the variable name and then setup a multiplier. I.e.

ps_givepoints (length * .75 )

So when it activates the taunt it gives the player 75% of how long the taunt is.

You will have to round using this method, as printshop does not handle double/float values and lua does not play friendly with them either.

Point Shop automatically rounds the number. And I Want to use the variable that had the amount of time in it. If Not we could always do a "If, else, elseif statement with categories of Short, Medium And Long Tags... Up To you.

well sorry for taking so long to reply, but i had no time to come :/ doing stuff.. so.. well.. right now I have this code.. ik the function name is probably wrong but well.. idk.. this is for a sound that would give me 1 point for the 1sec taunt that is "batman" but idk if it's correct or where to put it :/ and if there was a easier config that would use simply the time, instead of doing the code for each sound.. .-. well idk.. so you asked for the code, and well this is what i have..

function PS_GivePoints(ply)

if GAMEMODE:InRound() && ply:Alive() && (ply:Team() == TEAM_PROPS) then

local pointmult = 1

local pspoints = math.ceil(SoundDuration("taunts/batman1.mp3") * pointmult)

ply:PS_GivePoints(pspoints)

ply:PS_Notify("You've been given " .. pspoints .. " " .. POINTSHOP.Config.PointsName .." for taunting!")

end

end

Well Try Putting It At the bottom of init.lua in your taunt menu addon.