Hey
I'm an developer for
The Blade TTT Server and i am bit stuck on something with my code.
I'm making an Mini game for ttt that runs with ulx.
So far i code an Team Death-match where half of the people in the server become traitor and the other half detectives.
I'm now making the second Mini game called hidden.
This is where 1 player becomes an traitor and others detectives and the traitor is clocked and has to kill everyone.
So far a lot is working, player becomes an traitor others detectives and the traitor gets an knife.
Now where i am stuck on is this next part.
What i want is if the traitor uses the knife to kill an detective that he gets an new knife.
This part i am trying to code but every time the player get not an new knife.
This is the function i made for it.
function giveplayerknife()
--minigameplayer == The Player that is the traitor
minigameplayer:SetCredits(0)
minigameplayer:StripWeapons()
minigameplayer:Give("weapon_ttt_knife")
end
so i tried making an timer for it.
timer.Create("Give_Knife_Timer", 10, 0, giveplayerknife)
with
timer.Start("Give_Knife_Timer")
and
timer.Stop("Give_Knife_Timer")
This does nothing for some reason so i to do it with an hook:
hook.Add("weapon_ttt_knife:OnRemove()", "Give_Knife_Hook", giveplayerknife)
This is not working too.
So what i am asking here is:
What is the best way of doing this?
What am i doing wrong? (The hook maybe?)
How can i make it work?
Thanks for reading this.
Zero.