Hello guys, I hired a scripter for $3. He wrote a script to save the tool in the Data Store. It doesn’t work even though Value = true. They just don’t give me the tools, everything works great for him. Please tell me the script is written in GPT?
local DSS = game:GetService(“DataStoreService”)
local playersDB = DSS:GetDataStore(“playerssfd”)
local function savePlayerData(player)
local success, error = pcall(function()
local data = {
Ladder = player.Items.Ladder.Value,
GoldenRevolver = player.Items.GoldenRevolver.Value,
}
playersDB:SetAsync(tostring(player.UserId), data)
end)
if not success then
warn("Failed to save player data: " … tostring(error))
end
end
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new(“Folder”)
leaderstats.Name = “Items”
leaderstats.Parent = player
local ladder = Instance.new("BoolValue")
ladder.Name = "Ladder"
ladder.Parent = leaderstats
local GoldenRevolver = Instance.new("BoolValue")
GoldenRevolver.Name = "GoldenRevolver"
GoldenRevolver.Parent = leaderstats
local success, data = pcall(function()
return playersDB:GetAsync(tostring(player.UserId))
end)
if success and data then
ladder.Value = data.Ladder or false
GoldenRevolver.Value = data.GoldenRevolver or false
end
local Ladder = game.ServerStorage.dmin:WaitForChild("Ladder")
local revo = game.ServerStorage.dmin:WaitForChild("GoldenRevolver")
if player.Items.Ladder.Value == true then
local item = Ladder:Clone()
item.Parent = player.Backpack
print(player.Items.Ladder.Value)
else
print(player.Items.Ladder.Value)
end
if player.Items.GoldenRevolver.Value == true then
local item = revo:Clone()
item.Parent = player.Backpack
print(player.Items.GoldenRevolver.Value)
else
print(player.Items.Ladder.Value)
end
ladder.Changed:Connect(function()
savePlayerData(player)
end)
GoldenRevolver.Changed:Connect(function()
savePlayerData(player)
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
savePlayerData(player)
end)
Here are some screenshots.
As you can see, they don’t give me anything. I really ask for your help, I can’t do it alone.