Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I go on about using mouse on the server side ?

Asked by 4 years ago

local Script

local RemoteEvent = game.ReplicatedStorage.RemoteEvent

local Tool = script.Parent
local Handle = Tool.Handle

Tool.Equipped:Connect(function(mouse)

    mouse.Button1Down:Connect(function()
            RemoteEvent:FireServer(mouse.Hit.Position) -- I want to do this on the server side to prevent aimbot

    end)

end)

serverscript

local Remote = game.ReplicatedStorage.RemoteEvent
local UserInputService = game:GetService("UserInputService")


Remote.OnServerEvent:Connect(function(player)
--Define mouse on the server

end)

if not is there any safer or best way to do it ?

Answer this question