So I am trying to make a mounted machinegun follow the players mouse, but the players mouse always returns nil for some reason. I don’t know why. Here is my script;
local Part = script.Parent.PivitPart
local IsControlling = false
script.Parent.ControlButton.ProximityPrompt.Triggered:Connect(function(Player)
print(Player)
if IsControlling ~= true then
IsControlling = true
local Mouse = Player:GetMouse()
print(Mouse)
Mouse.Move:Connect(function()
Part.CFrame = CFrame.lookAt(Part.CFrame, Mouse.Hit.Position)
end)
else
IsControlling = false
end
end)
The script is a server script inside of the modal.