BindableEvent not received

Hi, I am trying to have te event communicate between a local and a server script, but it isn’t working or even printing anything. Here is my code:

Event fired

local player = game.Players.LocalPlayer

game.ReplicatedStorage.Events.PlayerTasks.OnClientEvent:Connect(function(task)
	if task == "ResetDoor" then
		script.Parent.Visible = true
		
		while true do
			local buttonsCompleted = {}
			
			for i, v in pairs(script.Parent:GetChildren()) do
				if v:IsA("TextButton") then
					if v.Active == false then
						table.insert(buttonsCompleted, v.Name)
					end
				end
			end
			wait(.01)
			if #buttonsCompleted == 12 then
				break
			end
			table.clear(buttonsCompleted)
		end
		script.Parent.FinalColor.BackgroundColor3 = Color3.fromRGB(0,255,0)
		wait(2)
		script.Parent.Visible = false
		
		print("Firing")
		game.ReplicatedStorage.Events.TaskCompleted:Fire("ResetDoor")
		print("Fired")
	end

end)

Server script:

game.ReplicatedStorage.Events.TaskCompleted.Event:Connect(function(TaskName)
	print(TaskName)
	if TaskName == "ResetDoor" then
		script.Parent.Completed.Value = true
	end
end)

Local script

game.ReplicatedStorage.Events.TaskCompleted.Event:Connect(function(TaskName)
	print(TaskName)
	if TaskName == "ResetDoor" then
		script.Parent.Parent.Parent.Doors.ExitDoor.Generator.Display.Color = Color3.fromRGB(0, 255, 0)
	end
end)

You need to use remote events rather than bindable events to communicate between client and server

1 Like

I added that, it works for the server side. The bindable is fired from a local script in startergui and received in a local script that’s parented to a part. It’s not being received

BindableEvents → Local Script to Local Script
RemoteEvents → Local Script to Script

LocalScripts do not work in Workspace.

1 Like

Then do I put the local script in startergui? Would that help change the color ONLY for the player?

You can put the LocalScript in StarterGui, but StarterPlayerScripts would be a better place for standalone LocalScripts.

2 Likes