Atlathic
(Atlathic)
November 7, 2021, 5:17pm
#1
How do I make a buy button, and whenever a player bought it an ‘equip button’ gets visible, if the player rejoins the button is still visible? (Please send script)
1 Like
Weren’t you asking for this exact script yesterday? I’m pretty sure you got several valid replies as solutions.
Hello, I am making a shop and inventory. With data store, what I want to do is whenever you pressed the buy button, u get an other button visible on ur screen, which shows as ‘equip’. This scripting works. I only don’t know how to add data store, I want whenever I joined the game again, that the button ‘equip’ is still showed, how can I do this?
local DSS = game:GetService("DataStoreService")
local DataStore = DSS:GetDataStore("SaveToolScript")
local players = game:GetService("Players")
local storage = game:GetService("ReplicatedStorage")
local buyToolItems = storage:WaitForChild("BuyToolItems")
players.PlayerAdded:Connect(function(plr)
local res = DataStore:GetAsync("User-"..plr.UserId)
if res then
for i,v in pairs(res) do
local storageTool = buyToolItems:FindFirstChild(v)
if storageTool then
local toolBackpack = storage…
Like this
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("Stats")
game.Players.PlayerAdded:Connect(function(plr)
local success, data, err = pcall(function()
return DataStore:GetAsync("User-"..plr.UserId)
end)
if success then
if type(data) == "table" then
for _, tool in pairs(data) do
local ToolFound = game.ReplicatedStorage.BuyToolItems:FindFirstChild(tool)
if ToolFound then
ToolFound:Clone().Parent = plr.…