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

my bindable event won't activate, why?

Asked by 6 years ago

so i made a GUI in startergui and gave it a script that would get activated if you press a certain button and it works just fine, but then i made a thing(don't know what it is called) that would activate an event aswell

local A1Fire = game:GetService("ReplicatedStorage"):WaitForChild("Attack1")

local Action1 = script.Parent.Frame.Action1

local function onAction1Click()
    A1Fire:Fire(Action1)
    print("attack1")
end

Action1.MouseButton1Click:connect(onAction1Click)

and I also made a script that would get activated and print ouch in output

local A1Fire = game:GetService("ReplicatedStorage"):WaitForChild("Attack1")

A1Fire.Event:connect(function()
    print("ouch1")
end)

Can you tell me whats wrong?

1
Bindable events are for server-to-server communication only. Use RemoteEvents for server-to-client or client-to-server communication. lukeb50 631 — 6y
0
^^^^^^^^^ Nowaha 459 — 6y
0
So where should i put the bindable event in superke12 -1 — 6y

1 answer

Log in to vote
0
Answered by
Nowaha 459 Moderation Voter
6 years ago

You need to do :FireServer or :FireClient or :FireAllClients, and you shouldn't put the events in the ReplicatedStorage. The workspace works fine.

http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent

0
its not a remote event its a bindable event superke12 -1 — 6y
0
I am blind rip Nowaha 459 — 6y
0
What error do you get? Nowaha 459 — 6y
0
it doesn't say anything thats what's annoying superke12 -1 — 6y
View all comments (4 more)
0
Why do you have 'local function' you dont need that just do function Nowaha 459 — 6y
0
oh ok superke12 -1 — 6y
0
well i tried it but nothing changed superke12 -1 — 6y
0
it needs to be remote abnotaddable 920 — 6y
Ad

Answer this question