it is a server script and when I try to get the value it comes up with the error ServerScriptService.Gravel.Script:4: attempt to index nil with 'DataFolder'
Gravel = workspace.Things.gravel
function gravel(player)
local DataStore = player.DataFolder.GravelColor --Line with error
while true do
if Gravel.BrickColor == "Cyan" then
DataStore.Value = 3
end
if Gravel.BrickColor == "Really Red" then
DataStore.Value = 1
end
if Gravel.BrickColor == "Buttermilk" then
DataStore.Value = 2
end
wait(.2)
end
end
while true do
gravel(game.Players.LocalPlayer)
end

2 comments
game.Players.LocalPlayer is nil on the server for obvious reason - it's not a client, server does not know who you want to specify. I also don't understand point of while loop on line 19, why when you have another one one in the function gravel.
I was just changing things around to see what would work and I forgot I had a while loop in the function and also that is why I have the local Player thing