Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make one script activate something in another?

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?

4 comments

0

Could you explain more?

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

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

0

When you want one script to activate another, use a remote event.

1 answer

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()

2 comments

0

Thanks, that actually makes sense, Ill have to write that down so I dont forget it

0

Glad I was capable of actually explaining something I learned :P. Normally I'm bad at that.

This discussion is preserved as it was. New answers, comments, and votes are closed.