jordan83221

Thing

May 17th, 2023
784
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.94 KB | None | 0 0
  1. -- Structure of the player profile
  2. local PlayerProfile = {
  3.   -- General information
  4.   id = "", -- Unique id of the player
  5.   title = "",
  6.   firstName = "",
  7.   lastName = "",
  8.   race = "",
  9.   class = "",
  10.  
  11.   -- Physical attributes
  12.   height = "",
  13.   bodyType = "",
  14.   sex = "",
  15.  
  16.   -- Custom sections
  17.   about = "",
  18.   kinks = "",
  19.  
  20.   -- Profile picture
  21.   picture = "",
  22.  
  23.   -- Options
  24.   options = {
  25.     showProfile = true, -- If false, the profile won't be visible to other players
  26.     showPicture = true, -- If false, the picture won't be visible to other players
  27.     showKinks = false, -- If false, the kinks section won't be visible to other players
  28.   }
  29. }
  30.  
  31. -- Function to create a new profile
  32. function NewProfile(id, title, firstName, lastName, race, class, height, bodyType, sex, about, kinks, picture, options)
  33.   local profile = PlayerProfile
  34.   profile.id = id
  35.   profile.title = title
  36.   profile.firstName = firstName
  37.   profile.lastName = lastName
  38.   profile.race = race
  39.   profile.class = class
  40.   profile.height = height
  41.   profile.bodyType = bodyType
  42.   profile.sex = sex
  43.   profile.about = about
  44.   profile.kinks = kinks
  45.   profile.picture = picture
  46.   profile.options = options
  47.   return profile
  48. end
  49.  
  50. -- Function to edit an existing profile
  51. function EditProfile(profile, field, newValue)
  52.   if profile[field] then
  53.     profile[field] = newValue
  54.   end
  55. end
  56.  
  57. -- Function to view a profile
  58. function ViewProfile(profile)
  59.   -- Here you would implement the code to view the profile based on its data and options
  60. end
  61.  
  62. -- Function to change profile options
  63. function ChangeProfileOptions(profile, option, newValue)
  64.   if profile.options[option] then
  65.     profile.options[option] = newValue
  66.   end
  67. end
  68.  
  69. -- Structure of the database
  70. local PlayerDatabase = {}
  71.  
  72. -- Function to add a profile to the database
  73. function AddProfileToDatabase(profile)
  74.   PlayerDatabase[profile.id] = profile
  75. end
  76.  
  77. -- Function to remove a profile from the database
  78. function RemoveProfileFromDatabase(id)
  79.   PlayerDatabase[id] = nil
  80. end
  81.  
  82. -- Function to search profiles in the database
  83. function SearchProfiles(query)
  84.   local results = {}
  85.   for id, profile in pairs(PlayerDatabase) do
  86.     if string.match(profile.firstName, query) or string.match(profile.lastName, query) then
  87.       table.insert(results, profile)
  88.     end
  89.   end
  90.   return results
  91. end
  92.  
  93. -- Function to view a profile based on the id
  94. function ViewProfile(id)
  95.   local profile = PlayerDatabase[id]
  96.   if profile and profile.options.showProfile then
  97.     -- Here you would implement the code to view the profile based on its data and options
  98.   end
  99. end
  100.  
  101. -- Function to edit the 'About' section of a profile
  102. function EditAboutSection(profile, newAboutText)
  103.   profile.about = newAboutText
  104. end
  105.  
  106. -- Function to edit the 'Kinks' section of a profile
  107. function EditKinksSection(profile, newKinksText)
  108.   profile.kinks = newKinksText
  109. end
  110.  
  111. -- Function to change visibility of the 'About' section
  112. function ChangeAboutVisibility(profile, visibility)
  113.   profile.options.showAbout = visibility
  114. end
  115.  
  116. -- Function to change visibility of the 'Kinks' section
  117. function ChangeKinksVisibility(profile, visibility)
  118.   profile.options.showKinks = visibility
  119. end
  120.  
  121. -- Function to view the 'About' section of a profile
  122. function ViewAboutSection(id)
  123.   local profile = PlayerDatabase[id]
  124.   if profile and profile.options.showAbout then
  125.     -- Display the 'About' section of the profile
  126.     return profile.about
  127.   else
  128.     -- Return a message indicating that the 'About' section is not visible
  129.     return "This section is not visible."
  130.   end
  131. end
  132.  
  133. -- Function to view the 'Kinks' section of a profile
  134. function ViewKinksSection(id)
  135.   local profile = PlayerDatabase[id]
  136.   if profile and profile.options.showKinks then
  137.     -- Display the 'Kinks' section of the profile
  138.     return profile.kinks
  139.   else
  140.     -- Return a message indicating that the 'Kinks' section is not visible
  141.     return "This section is not visible."
  142.   end
  143. end
  144.  
Advertisement
Add Comment
Please, Sign In to add comment