Hello, I’m making this system that makes a ui pop up and it says: Do you wanna leave an ornament in the christmas tree? And then you can choose between Yes or No, is it possible to make that if you press Yes, it adds an ornament to the tree for everyone? Since the mousebutton1click script is local, and I want it to happen for everyone, it seems difficult. I also want it to appear for people that join the game after it’s been added, so I don’t think RemoteEvents would work either.
I hope you can help!
This is where the communication between the server and client comes in. You would need a remote event, and fire it from the client(local script which is where the client(whoever the dude that is doing the mouse clicking) will do his picking to the server script. In the server is where you make it visible to everyone through (remote event here).OnServerEvent:Connect(function()). If you haven’t learned this please use the youtube videos out there. This communication is extremely crucial for a lot of made features in games.
FireServer fires from one of the local scripts into a script in the server, so that it can be viewed by everyone.
highly recommend watching this video: https://youtu.be/wCr5VXJ34T4
It fires the event on the server from the client side. Lets say you change colour of a part with this. It will change colour for everyone and for anyone who joins after.
Glad it worked out. Make sure to learn the parameters of FireServer(bunny,yeet) as well. In this case bunny and yeet are parameters that can be accessed by the Server from the client. They are basically information, and you can choose how ever many parameters your heart desires.
Still not working I tried it inside the textbutton and StarterGui, any works, maybe FireServer isn’t what I should be using, what else should I try then.
I did, it doesn’t work. I already placed the script, I for some reason think that :FireServer isn’t correct, maybe it should be something like :FireClient(the dude) and from that move it to the whole server