Hello, I have a local script that fires a remote event when the player clicks. That then fires a bindable event. Using print I can see the local script successfully fires every time, and the remote event receives.
However, the bindable event will stop working if I click too fast, refusing to ever receive.
I’m unsure how this occurs, and how to stop it.
Any suggestions are welcome.
player = game.Players.LocalPlayer Mouse = player:GetMouse() print("script running") check = 0 lamp = nil local debounce = false local oretable = game.ReplicatedStorage.ores:GetChildren() Mouse.Button1Down:Connect(function() task.wait() if debounce == false then debounce = true local mousetarget = Mouse.Target local targetsurface = Mouse.TargetSurface game.ReplicatedStorage.mousehit:FireServer(mousetarget, targetsurface) print("mouseevent") debounce = false end end)
Script receiving remote event and firing bindable
local tool = script.Parent local check = 0 local mousefunc tool.Activated:Connect(function() mousefunc = game.ReplicatedStorage.mousehit.OnServerEvent:Connect(function(player, mousetarget, targetsurface) if check == 0 then print("remote recieve") if player and mousetarget and targetsurface then if check == 0 and player:IsA("Player") and mousetarget:IsA("Instance") and math.abs((player.Character.PrimaryPart.Position - mousetarget.Position).Magnitude) <= 30 and tostring(typeof(targetsurface)) == "EnumItem" then local player = player local mousetarget = mousetarget local targetsurface = targetsurface game.ServerStorage.toolactive:Fire(player, mousetarget, targetsurface) check = 1 task.wait() check = 0 end end end mousefunc:Disconnect() end) end)
Script receiving bindable
local signalone signalone = game.ServerStorage.toolactive.Event:Connect(function(player, mousetarget, targetsurface) game.Workspace.EventValue.Value +=1 print("signalone started") check = 1
(It is worth mentioning the script above has a total of about 1200 lines which may be why it gets overloaded.)
A couple things you may want to know is that:
-There is no error in the output.
-The bindable event fails to receive only in that script, other scripts listening work correctly.