This is some simple code I wrote using Roblox Lua; my friends and I wanted to try out making a game where you can pick up hay, earn points, and then use it to get new items, and so on. Here's just a small part of it, the scripts for picking up hay, using Roblox's DataStore service to store the hay count on the server, and having the hay transition when hit.
Here's the testing game if you'd like to check it out yourself: https://www.roblox.com/games/5656817598/Hay-Simulator-Datastore-Test
Screenshots:
Structure of "Hay" objects/parts in game:
Placement of server-side scripts in ServerScriptService:
HayGUI script placement in the TextLabel to display the amount of hay collected:
In-Game perspective
Before collecting hay:
After collecting some hay: