How can we save data just like coins datastore i tried as a test to once the part was touched it will change color to red and save it forever but it didn't work I'm just curious if we can make it happen with datastore and how?
I saw Alvin Blox's video to create it
https://www.youtube.com/watch?v=DkYupSBUpes&t=617s
Yes i edited it and put part and things that i should put there but it still didn't work. here is the script take a look :
local Part = game.Workspace.Part
local player = game.Players.LocalPlayer
local DataS = game:GetService("DataStoreService")
local GetPart = DataS:GetDataStore("GetPartStuff")
game.Players.PlayerAdded:Connect(function(player)
Part.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
Part.Color = Color3.fromRGB(255,0,0)
DataS:GetAsync(player.UserId)
end
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
GetPart:SetAsync(player.UserId,Part.Color == Color3.fromRGB(255,0,0))
end)

1 comment
first assign a variable to the data inside DataS:GetAsync(player.UserId) then load that color, second save that color as a string or as 3 numbers, idk if .Color itself can save