I'm using Rocketmania's achievements addon from coderhire and basically I'm trying to make new achievements.
This one I'm working on at the moment is an achievement you get when you buy your first item from the pointshop.
There is something wrong with this but I don't know if it's the hook or something else..
[CODE]
if SERVER then
hook.Add("OnBuy", "ACV " .. "OnBuy" .. ACVMT.LuaName, function(ply)
ply:ACV_Increase(ACVMT.LuaName,1)
end)
end
[/CODE]
Thanks in advance!
You should probably contact the creator, especially since you got it from coderhire.
It's obviously a custom hook, which we probably won't magically know how it works, how it's hooked, and how to use it.
Oh yeah I forgot to mention the hook OnBuy is from pointshop.
Similiar problem, same solution, please contact the creator on coderhire we probably won't be able to help that much without seeing the code which I think is against the coderhire terms to share?
By similiar problem I mean this function:
[code]
ply:ACV_Increase(ACVMT.LuaName,1)
[/code]
We don't know what this function does magically.
EDIT:
Sorry got this thread confused with another.. so what issue are you having exactly? Errors? Is it not working? What?
[CODE][ply:ACV_Increase(ACVMT.LuaName,1)[/CODE]
This basically only adds "1" to the achievement progress and I know that part works fine. The only problem is the OnBuy part. I'm not that good at scripting so I really don't know how hooks work but when I wrote that I expected the addon to grab the OnBuy thing from pointshop (used when a player buy something) and add the achievement progress to the achievement code.
Add a print function and make sure that hook is even being called, also try using the achievement function elsewhere and see if that works.
[QUOTE=Jeezy;43552951]
Sorry got this thread confused with another.. so what issue are you having exactly? Errors? Is it not working? What?[/QUOTE]
The problem is that nothing happens when I actually buy something from the pointshop.
[editline]15th January 2014[/editline]
[QUOTE=Jeezy;43553013]Add a print function and make sure that hook is even being called, also try using the achievement function elsewhere and see if that works.[/QUOTE]
How do I do that? is it by adding this under the hook.Add? MsgN( "calling" )
[editline]15th January 2014[/editline]
Nothing gets printed :/
[editline]15th January 2014[/editline]
Looks like it's the pointshop hook that was causing the problem. I just changed it to PlayerSetModel and it worked.
Sorry, you need to Log In to post a reply to this thread.