Advertisement
drakon-firestone

CodesServer

Jun 10th, 2023
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. remotes:WaitForChild("UseCode").OnServerInvoke = function(player,code)
  2.     if codes[tostring(code)] then
  3.         if player.Codes then
  4.             if type(codes) == "table" then
  5.                 if player.Codes:FindFirstChild(tostring(code)) then
  6.                     return "Already"
  7.                 else
  8.                     if codes[tostring(code)][2] == true then
  9.                         return "Expired"
  10.                     else
  11.                         codes[tostring(code)][1](player)
  12.                         local usedCode = Instance.new("StringValue", player.Codes)
  13.                         usedCode.Name = tostring(code)
  14.                         return "Successfully"
  15.                     end
  16.                 end
  17.             else
  18.                 return "Unknown"
  19.             end
  20.         else
  21.             return "Unknown"
  22.         end
  23.     else
  24.         return "Invalid"
  25.     end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement