I am trying to make a ServerScript that needs to detect gui button presses. My script does not highlight as an invalid operation, but it simply doesnt work. I don't want to have to use a localscript, as i would like to make this a requireable modulescript.
CloseButton = game.Players.pname.PlayerGui.Gui.Frame.Button
CloseButton.MouseButton1Down:connect(function()
digga.Enabled = false
end)
Edit: Just to fully clarify this, i do not want to use a RemoteFunction or RemoteEvent as a method, plainly because i want to be able to make a ModuleScript with this in, upload it to Roblox and Require() it in a ServerScript. If you do not know how to solve this without the direct use of a pre-existing LocalScript then your method is not what i'm looking for.

6 comments
why do you need to do it on the server?
because it's going to be in a model that i can require in a script, and that script is gonna be a server script
just to clarify - you want to click a button and a model spawns then another script on the server is going to reference that model in a variable?
use a remoteevent
I don't want to have to use a localscript, as i would like to make this a requireable modulescript.
-1. You NEED a local script as user input/user interface should not be known by or handled by the server. Stick with your only option. Use remotes.