How should I do this?

So I’m making a dungeon-crawler game where you select classes/characters who have different stats, abilities, looks, etc. In the past two days, I have been trying to make an attack system. But, every single time I try it a no-error bug pops up and I can’t fix it.

The main problem, I think, is that I’m trying to get the mouse’s Hit.p data to a server script, and I just can’t.

I’m not asking for exact code, but could you recommend some things I could try. I already did modules and RemoteEvents.

Well, the dev forum reference API on remote events already has an example of a client to server data sending where they sent a color value and vector 3 data type similar to your mouse Hit.Position data which is also a vector 3 data type.

-- Include additional data when firing the event
remoteEvent:FireServer(BrickColor.Red(), Vector3.new(0, 25, 0))

Then the server script which receives the remote event

local ReplicatedStorage = game:GetService("ReplicatedStorage")
 
local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEventTest")
 
-- Create a new part
local function onCreatePart(player, partColor, partPos)
	print(player.Name .. " fired the remote event")
	local newPart = Instance.new("Part")
	newPart.BrickColor = partColor
	newPart.Position = partPos
	newPart.Parent = workspace
end
 
-- Call "onCreatePart()" when the client fires the remote event
remoteEvent.OnServerEvent:Connect(onCreatePart)

So in all what exactly did you do?

What exactly is happening in your script?

or maybe what is happening the way you not intended?

Sorry, but not enough information is provided. Portions of the script which you suspect are the problem could help narrow it down further.

Also, modules cannot transfer information from the local client to the server by themselves without remote events. So I’m especially curious about what you tried.