BindableEvent not working

i want to print simple true or false from ModuleScript and for some reason don’t work

i appreciate a lot if someone can help me.

ModuleScript:

local module = {}

function module.Event()
	local event = game:GetService("ServerStorage").MoveButton
	print("Before Fire")
	event:Fire(true)
	print("After Fire")
end

return module

ServerSide:

local Test = require(game:GetService("ServerScriptService").ModuleScript)
local Event = game:GetService("ServerStorage").MoveButton

Test.Event()
print("Before Event")
Event.Event:Connect(function(bool)
	if bool == true then
		print("You Are "..bool)
	elseif bool == false then
		print("You Are "..bool)
	end
end)
print("After Event")

Output:
image

ITS NOT PRINTING ANYTHING

It seems like you are firing the event before you listen to the event.
Try moving Test.Event() under your event listener.

local Test = require(game:GetService("ServerScriptService").ModuleScript)
local Event = game:GetService("ServerStorage").MoveButton

print("Before Event")
Event.Event:Connect(function(bool)
	if bool == true then
		print("You Are "..bool)
	elseif bool == false then
		print("You Are "..bool)
	end
end)
Test.Event()
print("After Event")

i am sorry for my dumb question i think i am stupid thanks for help :frowning:

1 Like

No worries!
Good luck with your project.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.