Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Bindable event not firing?

Hi, I have a bindable event that fires whenever a player has killed someone with a knife, this script works as its should but I am having some problems with firing the bindable event.

Also, basically this bindable event is just transferring two players names from one script to another.

--Knife script

kill = hit.Parent.Humanoid.Died:connect(function()
	print("Player has died")	
	game:GetService("ServerStorage").KilledPlr:Fire(script.Parent.Parent.Parent.Name,hit.Parent.Name)				
	wait(2)
	kill:disconnect()
end)

And yes, it prints "Player has died" but it does not fire the bindable event.

Here is the other server script recieving the bindable event.

local bindable = game:GetService("ServerStorage").KilledPlr

bindable.Event:Connect(function(plrname,plrkilled)
	print("Event fired")
	game:GetService("ServerStorage").DiedScreen.Main.KilledBy.Text = "You have been killed by "..plrname.."!"
	game:GetService("ServerStorage").DiedScreen:Clone().Parent = game:GetService("Players")[plrkilled].PlayerGui
	wait(3)
	game:GetService("Players")[plrkilled].PlayerGui.DiedScreen:Destroy()
end)

Basically the "Event" function doesnt run. This is really frustrating and I hope someone can help.

Additional info: Bindable event is stored in serverstorage.

Thanks!

6 comments

1

at least say what type of scripts they are

0

They are both server scripts, bindable events only use server scripts. Think before you comment bro.

0

Bindable events also work on the client. I personally use them and they function perfectly on the client.

0

bindable events are for server to server and client to client communication @iladoga

0

Did you make sure that both scripts are enabled?

0

Use a remoteevent instead.

1 answer

I know this is a year late, but I figured I'd post it anyway for others who come by later. I'm not sure why the bindable events aren't working, and I actually just encountered this same issue, but I found a fix for it that works for me. Use bindable functions instead of events. To be completely honest, I don't know the difference between the two, so there might be something with this idea that doesn't work, but either way, I'll post it. Here's a comparison of bindable event usage to bindable function usage:

Bindable Event: "Firing" Script:

bindableEvent:Fire(arg1,arg2)

"Fired" Script:

bindableEvent.Event:Connect(function(arg1,arg2)
	-- Insert script stuff here
end)

Bindable Function: "Firing" Script:

bindableFunction:Invoke(arg1,arg2)

"Fired" Script:

bindableFunction.OnInvoke = function(arg1,arg2)
	-- Insert script stuff here
end

I hope this helps anyone else who comes along and has this same issue like I did.

This discussion is preserved as it was. New answers, comments, and votes are closed.