please.
UserInputService
and Mouse.KeyDown()
is only for local script.
How can I detect key press with normal script??
You can't.
Mouse and Keybaord events (as well as other input events) can only be handled in LocalScripts. https://developer.roblox.com/en-us/articles/introduction-to-input
Mouse.Button1Down()
is when clicking
local KEYW = "Key" Mouse.KeyDown:Connect(function(key) if key == KEYW then end end)
is when key
Use a localscript for the mouseclick then use a remote to fire an event to the script.
It's not possible to detect a key press or mouse button press from a server script, as these are both local things. If you want something to happen in a server script when a key press or mouse button press is detected, use a RemoteEvent and fire the server from a LocalScript when pressed.