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

What is a good way to use bindable events in an FE game?

Asked by 5 years ago

So i watched AlvinBLOX's tutorial on bindable events, and he said bindable events allow for 2 scripts of the same kind (script with script. localscript with localscript) to "communicate" with each other. Now my question is if you can write it like this:

wait(3)

game.Workspace.Baseplate.BrickColor = BrickColor.new("Really Red")

instead of this:

local bindableevent = game.Workspace:WaitForChild("BindableEvent")

wait(3)

bindableevent:Fire

(this part is in another script)

local bindableevent = game.Workspace:WaitForChild("BindableEvent")

bindableevent.Event:Connect(function()

    game.Workspace.Baseplate.BrickColor = BrickColor.new("Really Red")

end)

then why would you use bindable events?

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Let's say you have a script that manages your player data, and you can only increase/decrease the player's current currency through that script. Whenever an outside script would want to increase/decrease the currency, you'd use a bindable event. Basically you use bindable events whenever you want to do something a script can but from a script that can't. There are also better examples but I can't think of any because I'm dumb.

Ad

Answer this question