so i tried to make a simple script that literally just saves a brick color. heres the not working script:
local datastore = game:GetService("DataStoreService") local ds1 = datastore:GetDataStore("DS1") game.Players.PlayerAdded:Connect(function(plr) local part= game.Workspace.Part local success,err = pcall(function() part.BrickColor = ds1:GetAsync(plr.UserId) end) if success then print("Your Data Has Been Loaded.") else print("Your Data Loading Has Failed.") warn(err) end end) game.Players.PlayerRemoving:Connect(function(plr) local part= game.Workspace.Part local success,err = pcall(function() ds1:SetAsync(plr.UserId, part.BrickColor) end) if success then print("Your Data Has Been Saved.") else print("We Got An Error While Saving Your Data.") warn(err) end end)
i would appreciate any help.