I need some help about an egg collecting system

i need to make an egg hunt event for my game which is coming tuesday, and i need to be like where you get an egg and it tells u that u have 1/5 eggs collected

does anybody know how to make a script where you go to an egg and it tells you how many eggs you collected?

2 Likes

So you want a system where a player touches an egg, it collects and tells them how many they have left to collect?

1 Like

It’s kind of hard to post all the sytems you would need here.
I think I could make it for you.

1 Like

exactly
thats what im trying to say on my post

how are you able to make one for me

I can try making one that you can add to the game or you could give me access to the game so I could add it.
But I understand if you dont feel comfortable letting me edit the game.
So I can make it either way.

1 Like

you could try making one so i could add it to the game
all i need is just the script for the gui that will be something like this: a player collects the egg and the gui will tell you how many eggs u have depending on how many eggs a person like something like “1/5 eggs collected”

btw hopefully u are probably able to understand this lol

1 Like

Oh ok I see. I can make that, brb while I code it

game.ReplicatedStorage.Events.CollectedEgg.OnClientEvent:Connect(function(Eggnumber)

	script.Parent.Visible = true
	script.Parent.Text = "Egg "..Eggnumber.."/5 Collected"
	wait(3)
	script.Parent.Visible = false

end)

Is this what you need?
All you need to do is fire this remote event and send the egg number over when they collect an egg

I don’t know how your collection system currently works, but I’ll tell how I would do it.

I would have my character’s Player model have a folder of IntValues and I would have values set to 0 for unobtained eggs and 1 for obtained eggs. The touched function of the various eggs would change their respective IntValue to 1 when obtained. In the gui you mentioned, I would have a function with an Instance.Changed statement that updates the gui when the IntValues in the Player folder change. The update would be the sum of the IntValues.

Alternatively, Attributes could be utilized in place of IntValues.