I Have been trying to figure this out all day an I swear I'm going to have a mental breakdown by the end of the day
so its a VERY VERY basic datastore saving script that is not not working for some odd reason
game.Players.PlayerRemoving:Connect(function(Player)
local success, errormessage = pcall(function() -- Pcall
KnifeData:SetAsync(tostring(Player.UserId).."-THKnive", game.ServerStorage.PlayerInfo:FindFirstChild(Player.Name):FindFirstChild("ThrownKnives").Value) -- Gets the value from a IntValue that is created when the player joins
wait() -- Waits to clean up
game.ServerStorage.PlayerInfo:FindFirstChild(Player.Name):Destroy() -- Cleans Up
end)
if success then -- It saved. Indicate that.
print("Saved "..Player.Name.."'s KniveData")
else
warn("Error While Saving "..Player.Name.."'s Data")
warn(errormessage)
end
end)
this will sometimes work but most of the time not and it is not reliable
I swear if this is very simple I will be so mad. Or glad. Depends

1 comment
Seems like this works. Thanks!