Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Can I Make A Data Store For My GUI Quest With Images?

Asked by
ImfaoXD 158
8 years ago

Am I doing this right? I'm trying to make this script save all of the data from from my GUI. Like for example; I made a quest GUI and a player have to collect a certain of stone and if they collect one of them, then the image will show up. an you guys help me? Thank you for your time!

This is a normal script

script.DataStoreLib.Parent = Game.ServerStorage
wait()
script:Destroy()

This is a module script that is place inside of the normal script.

DataStore = {}
DataStore.__index = DataStore
function DataStore.ds(name)
    if type(name) ~= "string" then return end
    local ds = game:GetService("DataStoreService"):GetDataStore(name)
    local meta = {}
    setmetatable(meta, DataStore)
    meta.data = ds
    return meta
end

function DataStore:set(key, value)
    self.data:SetAsync(""..key, value)
end

function DataStore:get(key)
    return self.data:GetAsync(key)
end

return DataStore
0
Module scripts need to be "required" in order to make them run/ use them Validark 1580 — 8y
0
How can I do that? I never done this before. D: ImfaoXD 158 — 8y

Answer this question