Im trying to get player's mouse position. But im getting ServerScriptService.DamagableManager:48: attempt to index local 'mouse' (a nil value) error
LocalScript that im trying to connect to Server Script:
local function onMousedClicked(actionName,inputState, inputObject)
if inputState == Enum.UserInputState.Begin then
CheckIfDamagable:InvokeServer()
print("MouseClicked")
end
end
server Script that im tring to get mouse info:
function CheckIfDamagableObject(player)
local mouse = player:GetMouse()
--Unrelated codes here
end
CheckIfDamagable.OnServerInvoke = CheckIfDamagableObject

2 comments
the problem is im trying to use ray casting method for it and because of that i need mouse position
You can raycast on the localscript and then pass the necessary information from the raycast to the server