Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How could I make an int shared and modified by all players?

Asked by 4 years ago

Hi! I apologize if I'm missing something super simple because I'm pretty new to Roblox scripting.

So I've been working on a button where everyone needs to work together to get a certain number of clicks on this button to progress. Basically, if one person clicks it adds 1 to the total value of clicks.

But how would I make this variable? I've been searching for some sort of variable type that can handle all the clicks from everyone. I tried using an IntValue but that didn't seem to work. When I tested the game with my friend, the text that said the number of clicks was different on both of our screens. When I'd click it would add 1 to the value on my screen, but on his screen, it would say 0 still.

Could you please help me? Also, this isn't a request, I would just like someone to inform me of how I would achieve this. Thanks! :)

1 answer

Log in to vote
0
Answered by
VitroxVox 884 Moderation Voter
4 years ago
Edited 4 years ago

Hello!, That's because you're using an localscript which is client sided and that's why you guys see different values on each screen it cause a localscript can't make changes on the server side only the local client's side, so you'd need to make it FE and you'd need to use remote events for it to work, if you contact me on discord Vitrox#6993 , i'm willing/happy to help you to set it up.

0
Thanks! I will try using remote events. proqrammed 285 — 4y
0
No problem, :D VitroxVox 884 — 4y
0
Quick update, it all works. THANK YOU SO MUCH! proqrammed 285 — 4y
Ad

Answer this question