Nothing running after these lines

Hey, I am super confused why my code is not running after the .Activated event.

	elseif RunService:IsClient() then

		local Player = game.Players.LocalPlayer
		local Character = PlayerAdded(Player)
		local Humanoid = Character:FindFirstChild("Humanoid")

-- IT GETS PAST THE VARIABLES; NVG IS CONFIRMED TO BE A TOOL!

		self._Maid:GiveTask(
			self.NVG.Activated:Connect(function()
-- I CLICK AND NOTHING SEEMS TO HAPPEN??? NOT EVEN A PRINT EVEN RUNS HERE.
				Equip:FireServer(Player)

				UserInputService.InputBegan:Connect(function(...)
					self:Pressed(...)
				end)
			end)
		)

Any help is good help. Thanks.

1 Like

Is there any event other than Activated fire like MouseButton1Click?

Nope, I have no clue why it is not working.

Maybe try to connect the function outside the Maid environment?

1 Like

Just tried:

	self.NVG.Activated:Connect(function()
			print("here")
			Equip:FireServer(Player)

			UserInputService.InputBegan:Connect(function(...)
				self:Pressed(...)
			end)
		end)

Nothing ran.

I also added a function to the maid module to see if it was even running; it does.

1 Like

Okay, so I actually don’t know the exact problem, but there might be a GUI or something that is messing up the screen and not allowing the mouse button clicks to be received.

Nope!

self._Maid:GiveTask(
			Mouse.Button1Down:Connect(function()
				print("Clicked")
			end)
		)

https://gyazo.com/cfbb4721b7c1227f6235c800e45a2024

Thank you Roblox for being so confusing smh.

Just asking, does the NVG tool require a handle?
image

Yes, it does require a handle.

Probably the last checks:

  • Does the event Equipped fire?
  • Check the ManualActivationOnly property of the tool
  • Check the Enabled tool property
  • Restart your studio (maybe a studio bug or something)

Okay…the equipped event does not fire. I am unsure why it doesn’t. Even though self.NVG returns a tool.

Are you sure that the NVG does have a part called ‘Handle’?

https://gyazo.com/39040634511cf064531a80ef15ea2190

Okay.
At least, does the event fire while connecting it from another script with direct reference?

Thats an odd problem tbh…

It does fire the event from a direct reference. I would say that it could be that I am using CollectionService to get the NVG, but I always use CollectionService and it works fine.

I haven’t tried CollectionService while working with tools, you might want to implement your code with another approach. Idk.

I’ll see if I can, I saw other games use ColllectionService with tools, idek anymore.

Thanks for the help though!
I’ll let you know if I find a solution.

Do you use local scripts? Even if you are on a client, you can only run the activated and input events on a local script.

Thats not true, tool events can be registered on the server.

How did you obtain this information? Almost all of the tools I’ve seen utilize remote events. Is it true that the server can read client input?