Theres Absolutely No Errors But My Module Seems To Not Run. I’ve Done Module Loader And Manual From The Client.
--Create Table
local Module = setmetatable({}, {__index = function() --Returns Function On Attempted Indexing
return "Invalid Index" --Return String On Invalid Indexing
end,})
--// Handles Input On The Client And Fires To Server Front-End
function Module.Input_Manager(Mouse : PlayerMouse)
Mouse.Button1Down:Connect(function() --//On Left Click Return Function
local ReplicatedStorage = game:GetService("ReplicatedStorage") --//Get ReplicatedStorage
local OnMouse = ReplicatedStorage["Events"]["OnMouse"] --//Get OnMouse Remote Event
OnMouse:FireServer({"Base"}) --Returns Table Of Info For Server
end)
end
--//OnMouse Remote Event Handler
function Module.OnServer()
return warn("Test: Hello")
end
--// Initialize Every Function In The Module
function Module:Init()
local ReplicatedStorage = game:GetService("ReplicatedStorage") --//Get ReplicatedStorage
local OnMouse = ReplicatedStorage["Events"]["OnMouse"] --//Get OnMouse Remote Event
local Players = game:GetService("Players")
local Mouse = Players["LocalPlayer"]:GetMouse()
Module:Input_Manager(Mouse) --//Passes In Clients Mouse Properties
OnMouse.OnServerEvent:Connect(function() Module:OnServer() end) --// OnMouse Event Function
end
return Module --Return Module For Module Loader