Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local FilePath = "n"
- local Key = "23"
- local function GetPath()
- FilePath = fs.find(".Secured_Token2")
- end
- GetPath()
- function GetBalance()
- local Path = fs.combine(FilePath,".Secured_Token2","Gold")
- local Tokens = fs.list(Path)
- local balance = 0
- for i = 1, #Tokens do
- local file = fs.open(fs.combine(Path,Tokens[i]),"r")
- local Line = file.readAll()
- if string.find(Line,Key) == true then
- balance = balance + 1
- end
- file.close()
- end
- return balance
- end
- function transferToken(amount)
- if GetBalance() >= amount then
- local Path = fs.combine(FilePath,".Secured_Token2","Gold")
- local Coin = fs.list(Path)
- local Table = {}
- for i = 1, amount do
- local file2 = fs.open(fs.combine(Path,Coin[i]),"r")
- local content = file2.readall()
- file2.close()
- fs.delete(fs.combine(Path,Coin[i]))
- Table[i] = {Coin[i],content}
- end
- return Table
- else
- return false
- end
- end
- function DownloadToken(name,code)
- local path = fs.combine(FilePath,".Secured_Token2","Gold")
- local Item = fs.open(fs.combine(path,name),"w")
- Item.write(code)
- Item.close()
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement