Help with using a bindable event

Hello,

I am trying to have a module script that is in charge of my datastore fire a bindable vent when it is done retrieving data. This bindable event will then be picked up by server and client scripts to continue the game. However, it is not firing. The way I call it in my module script is like this;

local player_loaded = game.ReplicatedStorage.Events.PlayerLoaded
player_loaded:Fire()

and then in my client script I have this;

local function updateStatsUI()
	
	local player = game.Players.LocalPlayer
	local player_data = player.PlayerData
	local money = player_data.PlayerMoney.Value
	local bounty = player_data.PlayerBounty.Value

	script.Parent.StatsFrame.Frame.Money_txt.Text = 'Money: '..money
	script.Parent.StatsFrame.Frame.Bounty_txt.Text = 'Bounty: '..bounty
	
end

local player_loaded = player_loaded.Event:Connect(function()
	updateStatsUI()
end)

why is this not working?

Thank you I was looking through the documentation but must’ve missed this. This leads me now to another problem I cant fire server with a remote event on my module(it is being required through the server as well.)

The remote event instance should be located in a place where its replicated between the server and clients, i.e. ReplicatedStorage or workspace
it won’t work if it’s parented under something that won’t replicate (i.e. a client-sided modulescript)

No sorry for not clarifying I have stored my remote event in replicated storage. I am just calling the player_loaded:FireServer() from a module that is being required by a server script. However this will not work for some reason it seems that it never fires.

Can you show me the module?
Also, are you sure you’re firing the remote in the module? Simply requiring a module only gets what’s returned by the modulescript, it won’t necessarily run anything

There’s a little bit of code here since this is a segment of my datastore module but here it is;
here’s my layout;
image

This is in ServerBootstrapper

local PlayerHandler = require(game.ReplicatedStorage.Modules.Server.PlayerHandler)

This is in PlayerHandler

player_loaded.OnServerEvent:Wait()
player_loaded:FireClient(player)

This is in PlayerData

local player_added = game.Players.PlayerAdded:Connect(function(p)
	player = p
	
	--player data folder
	local player_data = Instance.new('Folder')
	player_data.Name = 'PlayerData'
	player_data.Parent = player
	
	--player money value
	local player_money = Instance.new('NumberValue')
	player_money.Name = 'PlayerMoney'
	player_money.Parent = player_data
	
	--player bounty value
	local player_bounty = Instance.new('NumberValue')
	player_bounty.Name = 'PlayerBounty'
	player_bounty.Parent = player_data
	
	--player time played value
	local player_time_played = Instance.new('NumberValue')
	player_time_played.Name = 'PlayerTimePlayed'
	player_time_played.Parent = player_data
	
	--player kills value
	local player_kills = Instance.new('NumberValue')
	player_kills.Name = 'PlayerKills'
	player_kills.Parent = player_data
	
	--player deaths value
	local player_deaths = Instance.new('NumberValue')
	player_deaths.Name = 'PlayerDeaths'
	player_deaths.Parent = player_data
	
	--get data
	local player_id = 'Player_'.. p.UserId
	local data
	return promise_class.new(function(resolve, reject, on_cancel)
		resolve(data_store:GetAsync(player_id))
	end)
	:andThen(function(result)
		data = result
		
		player_money.Value = data[player_money.Name]
		player_bounty.Value = data[player_bounty.Name]
		player_time_played.Value = data[player_time_played.Name]
		player_kills.Value = data[player_kills.Name]
		player_deaths.Value = data[player_deaths.Name]
		
		player_loaded:FireServer() --Here I fire the event
	end)
	:catch(function()
		player_money.Value = 0
		player_bounty.Value = 0
		player_time_played.Value = 0
		player_kills.Value = 0
		player_deaths.Value = 0
	end)
end)

Where exactly is this located? Is it inside a function which is then returned by the modulescript?
Also, it appears that you’re waiting for the client to fire the remote first; did you check to see if the client even fired it?

I’m sorry for wasting your time I have figured out the solution all I had to do was instead of using a remote event to fire back I just had to use the return of the module to execute code. Sorry again but you did help!