At first my ends worked perfectly and suddenly they broke. It is in a regular script. Here is my script(it's from an AlvinBlox tutorial bc i suck at stats):
local serverStorage = game:GetService("ServerStorage")
local DataStore = game:GetService("DataStoreService"):GetDataStore("PlayerSaveData")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local strength = Instance.new("NumberValue")
strength.Name = "Strength"
strength.Parent = leaderstats
local rebirths = Instance.new("IntValue")
rebirths.Name = "Rebirths"
rebirths.Parent = leaderstats
local dataFolder = Instance.new("Folder")
dataFolder.Name = player.Name
dataFolder.Parent = serverStorage.RemoteData
local debounce = Instance.new("BoolValue")
debounce.Name = "Debounce"
debounce.Parent = dataFolder
local strengthData, rebirthsData
local success,errormessage = pcall(function()
strengthData = DataStore:GetAsync("strength-"..player.UserId)
rebirthsData = DataStore:GetAsync("rebirths-"..player.UserId)
if success then
if strengthData then
strength.Value = strengthData
rebirths.Value = rebirthsData
end
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local success, errormessage = pcall(function()
DataStore:SetAsync("strength-"..player.UserId,player.leaderstats.Strength.Value)
DataStore:SetAsync("rebirths-"..player.UserId,player.leaderstats.Strength.Value)
end)
end)

6 comments
thanks for trying to help but it didn't work. I've tried so many combinations and still get and error. If you need it, here is the error message I received when doing that: Error: (38,5) Expected identifier when parsing expression, got ')'
try now. that font bit wasnt supposed to be there
I made a edit to the script, try it now
ugh still wont work
add me on Discord xWhiteHat#4788
k i did