Advertisement
Lukyspore

sh_custom_achievements.lua

Oct 30th, 2023
1,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. --[[  
  2. To create a new achievement you need to copy this code bellow.
  3.  
  4. do
  5.     local achievement = {
  6.         AchievementName = "New Achievement",
  7.         Description = "Achievements description",
  8.         Icon = "ldt_achievements/achievements/house.png",
  9.         MaxProgress = 1,
  10.         RewardAmount = 1000,
  11.     }
  12.  
  13.     LDT_Achievements.RegisterAchievementsToCategory('General', achievement)
  14.  
  15.     if SERVER then
  16.         hook.Add( "PlayerDeath", "LDT_Achievements.AchievementsName", function( victim, inflictor, attacker )
  17.             if victim == attacker then return end
  18.             if not IsValid(attacker) then return end
  19.  
  20.             LDT_Achievements.AddAchievementProgress(attacker, achievement.AchievementID, 1)
  21.         end )
  22.     end
  23. end
  24.  
  25. The Name is the name that is displayed in the menu. IT HAS TO BE UNIQUE!
  26. The Description is the description that is displayed in the menu.
  27. The Icon is the icon that is displayed in the menu.
  28. The MaxProgress is the amount of progress you need to complete the achievement.
  29. The RewardAmount is the amount of money you get when you complete the achievement. If you don't want to give money set it to 0.
  30.  
  31. The hook.Add is the hook that is used to check if the achievement is completed.
  32. You need to know what hook to use for the achievement you want to create. So a little bit of lua knowledge is required.
  33. --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement