i dont have a clue what is wrong here at all!!!
ive been trying for ages ;(
data = game:GetService("DataStoreService")
save = data:GetDataStore("Tools")
game.Players.PlayerAdded:connect(function(player)
k = player.Backpack:WaitForChild("BDtest")
k.Value = save:GetAsync(player.UserId) or 0
save:SetAsync(player.UserId, k.Value)
game.Players:WaitForChild(player)
k.Changed:connect(function()
save:SetAsync(player.UserId, k.Value)
end)
if k.Value == 1 then
game.ReplicatedStorage.vamp["Blood Drain"]:Clone().Parent = player:WaitForChild("Backpack")
player.Backpack["Stone Mask"]:Destroy()
save:SetAsync(player.UserId, k.Value)
end
end)
game.Players.PlayerRemoving:connect(function(player)
local k = player.Backpack:WaitForChild("BDtest")
save:SetAsync(player.UserId, k.Value)
if k.Value == 1 then
save:SetAsync(player.UserId, k.Value)
end
end)

1 comment
tried print debugging?