Doesn't give up the tool

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.

image

image
As you can see, they don’t give me anything. I really ask for your help, I can’t do it alone.

1 Like

If it’s important, I have two DataStores. One with money, one with saving tools. Can they conflict?

local DSS = game:GetService(“DataStoreService”)
local playersDB = DSS:GetDataStore(“players”)

game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new(“Folder”)
leaderstats.Name = “leaderstats”
leaderstats.Parent = player

local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Parent = leaderstats

local energy = Instance.new("IntValue")
energy.Name = "Energy"
energy.Parent = leaderstats

local rcoin = Instance.new("IntValue")
rcoin.Name = "RCoin"
rcoin.Parent = leaderstats

local OwnsTycoon = Instance.new("BoolValue", player)
OwnsTycoon.Name = "OwnsTycoon"
OwnsTycoon.Value = false

local success, data = pcall(function()
	return playersDB:GetAsync(tostring(player.UserId))
end)

if success and data then
	cash.Value = data.cash or 0
	energy.Value = data.energy or 0
	rcoin.Value = data.rcoin or 0
end

end)

game.Players.PlayerRemoving:Connect(function(player)
local success, error = pcall(function()
local data = {
cash = player.leaderstats.Cash.Value,
energy = player.leaderstats.Energy.Value,
rcoin = player.leaderstats.RCoin.Value
}
playersDB:SetAsync(tostring(player.UserId), data)
end)
end)