I want to try making an egg hunt event for my game, there are several kits out there and a few tutorials but none of them do what I want them to.
All I’m asking is for the local player to find about 5 eggs manually hidden in the world, when the local player has collected all of their eggs on their client then they will be awarded with a badge.
I see a lot of non official egg hunt games have a simple system like this. No fancy guis or inventory systems, just touch every egg and get rewarded with a badge. If I could get a template or tutorial for something like that then that would be nice.
I would suggest having the eggs around the map, but have them in a model.
You can check the number of eggs in that model each time the player collects one, and once they’re finished you can use InvokeServer on a RemoteFunction to give the player a badge once they have all the eggs.
If you’re looking for a quest system, I think the best way to get started is using a ModuleScript to handle your quest system.
Making this on the server would be easier and better.
Make a simple counting system, detect when the player touches an egg on the workspace, increase the count, when the count goes to 5, give the player the badge.
This would also prevent exploiters.
I actually made something similar, but with coins.
Make a Folder and parent it to the player.
Make 5 BoolValues and parent them to that folder.
Name every Value something like ‘Egg1’, ‘Egg2’, etc.
Inside of every egg, make a touched event that changes the corresponding value to true.
Make a LocalScript inside of StarterPlayerScripts and make a Changed event checking if they own all of them, if they do, fire a RemoteEvent that awards the badge to the player the Event was fired from.
Make a DataStore saving al the values when a player leaves and make it load back in when they rejoin.
This is roughly how I did it, I was too dumb to actually save the scripts I wrote for the actual event and the even isnt in the main game anymore, so I couldn’t see exactly how I did it.
Hope this helped ya!
Edit: For anti exploit you could just make it check again if they have all those values to true after the event was fired.