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

How do I make one script activate something in another?

Asked by 4 years ago

For example, if I wanted one GUI button to make multiple things move at the same time using 1 script for the button and 1 per thing I wanted to move, how would I make that work? Is it possible to make it client based so that it only happens for the person activating the button?

0
Could you explain more? Ziffixture 6913 — 4y
0
I want 1 button to be able to i guess some how transmit a signal to other scripts so that I can easily add things to that button later. So basically, a button activates a function in one script, and that function tells another function from a different script to activate Rhynokeros 0 — 4y
0
there might be a way to do it with one script... I mean to make something like a wave start for something like a tower defense game. You click the button and all sorts of different zombies start moving Rhynokeros 0 — 4y
0
When you want one script to activate another, use a remote event. AntiWorldliness 868 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You can create a remote event object and put it in Replicated Storage. It doesn't have to be Replicated storage but it's a good place for remote events. Then all you have to do is something like game.ReplicatedStorage.RemoteEvent:FireClient() to fire an event. Then, you can have a local script that says something like game.ReplicatedStorage.RemoteEvent.OnClientEvent: --Do Stuff. If you want to send a signal from client to server, then do the same thing but replace FireClient() with FireServer()

0
Thanks, that actually makes sense, Ill have to write that down so I dont forget it Rhynokeros 0 — 4y
0
Glad I was capable of actually explaining something I learned :P. Normally I'm bad at that. eyeball001 7 — 4y
Ad

Answer this question