Disk is a Programmable Object that can be used to write and read. Maximum storage of Disk is 10KB. There are 4 codes of Disk: Write(key, data) write data giving a string key, Read(key) only returns a given value of a disk, ClearDisk() clears all value and data in a disk, ReadEntireDisk() returns the entire disk table, all value, and all data.
Example:
local Button = GetPartFromPort(2, "Button")
local Disk = GetPartFromPort(2, "Disk")
local OffButton = GetPartFromPort(3, "Button")
Disk:Write(1, false)
local function Fire()
Disk:Write(1, not Disk:Read(1))
repeat
TriggerPort(1)
wait(0.1)
until not Disk:Read(1)
end
Button:ConnectToEvent("OnClick", Fire)
OffButton:ConnectToEvent("OnClick", function()
Disk:Write(1, not Disk:Read(1))
end)
In-game description
"A programmable object capable of storing data. Has a limit of 10kb of data. Has 4 functions that allow you to edit the disk. Write(key, value) writes a value to the disk with a key. Read(key) returns a given value of a disk. ClearDisk() clears the entire disk. ReadEntireDisk() returns the entire disk table. **Be aware, while disks can store userdata values, it cannot save them properly"
Misc
Recipe
Raw Recipe
Malleability
Maximum Size: 20*20*20
Default Size: 2*1*2
Configurable
Not Configured