Thank you, it work ur awesome, but i just wanna benefit from this post because i have another problem with another quest that I coded but the quest don't work i don't understand why, the goal of the quest is to win 1 points for every kill and lose 20% of ur points for every death, and to display the number of points IG in the inventory like this [Hidden Content]
But the problem here is that when I do a kill i receive 1 points, but when I die i lose all my points and if I kill a player with like 20 points and I got 0 points the player is gonna lose all his points and I am gonna receive 18 points something like that i tried to solve it by my own but I'am a beginner in this language so i don't understand why it don't work
That's the quest
quest pvp begin
state start begin
when kill with npc.is_pc() begin
pc.setqf("nbpoints", pc.getqf("nbpoints") + 1)
local coins = pc.getqf("nbpoints")
cmdchat("PointsPVP "..coins)
syschat ("Vous recevez 1 points")
local old = pc.select(npc.get_vid())
pts = pc.getf("pvp","nbpoints")
pc.setf("pvp","nbpoints", math.floor(pts*0.8))
local coins = pc.getf("pvp", "nbpoints")
cmdchat("PointsPVP "..coins)
diff = pts - pc.getf("pvp","nbpoints")
if diff == 0 then syschat("Vous ne perdez aucun points")
else
syschat("Vous perdez "..diff.." points")
end
pc.select(old)
end
end
end
If someone could help me it would be amazing,