BindableEvent not working

I am currently working on an dealership system, I am using an BindableEvent to show the vehicle purchase frame, however it is not working and i cant spot any error in it

Here is the code:

local CarParams = game.ReplicatedStorage:WaitForChild("GetCarParams"):InvokeServer(script.Parent.Name)
local CarImage = script.Parent.CarImage
local ShowPurchaseFrame = script.Parent.Parent.Parent.Parent.Parent.ShowPurchaseFrame

script.Parent.CarName.Text = CarParams.Name
script.Parent.Cost.Text = CarParams.Cost

script.Parent.MouseButton1Down:Connect(function()
	ShowPurchaseFrame:Fire(CarParams.Name, CarParams.Cost, CarParams.Power, script.Parent.CarImage)
end)

Any help is appriciated, thanks

1 Like

Try printing showPurchaseFrame to make sure it is the bindableEvent (that is a lot of parents and easy to confuse).

Add a print to the function which calls it to check the mouse button event is firing correctly.

Check the code in the other script which would actually change the UI to show the frame. The issue might be in there.

the print function is working yet the ui is not opening

Ok, so could we see the code listening for the fire event?

(Ignore the audio it is supposed to be in the game)

There seem to be a lot of errors, from what I can see they are mostly ‘unable to find’ something type errors.
I would say the issue is almost certainly in a different script which means the showPurchaseFrame function isn’t being connected to the bindable event.

This could be something as simple as a folder being named incorrectly, or some part not loading before the script looks for it.

Start by checking the script where, ShowPurchaseFrame.Event:Connect(function) appears.

The other errors are http errors, otherwise the print function seems to be working

I only have one script for the BindableEvent

I already checked the folder names,etc. and everything seems to be named correctly


Still have no clue about the error, I tried changing the script a bit and it still was not working properly

So where does this Fire to? Not the bindableEvent itself, but the code that runs :Connect() with a function to run?

it fires to remote function which is supposed to get vehcile info from a folder in ServerStorage which has the vehicles and their info in it

I am slightly confused as to the set up here.
Bindable events can’t fire across the client-server boundary, remote events can but are called by :fireClient or :fireallclients or :fireserver.

I assume this is on the client using a bindable event, but the client has no access to serverstorage only replicated storage.

So, you will need to either,
Change the event to a remoteevent to run a serverside function to gain access to serverstorage and change the playergui from there, or,
Move the info to replicated storage.

Hope that makes sense.