Hello, I am asking how can I send Mouse.Hit inputs to server scripts. So, I'm trying to make grappling, but it only prints out my string that I put in and doesn't put the attachment inside of the Mouse.Hit.Parent. P.S the grappling needs to go towards the mouse. I have both a localscript and server script.
--Localscript
local mouse = game.Players.LocalPlayer:GetMouse()
local player = game.Players.LocalPlayer
local char = player.Character
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
game.ReplicatedStorage.RightGrapple:FireServer(char, mouse)
end
end)
--Script
game.ReplicatedStorage.RightGrapple.OnServerEvent:Connect(function(char, mouse)
local grappleright = coroutine.create(function()
print("weeee we go on hook yey")
local attachment = Instance.new("Attachment",mouse.Hit.Parent)
attachment.Position = mouse.Hit
local magichookthing = char.magixx.Welds.RightContainer:FindFirstChild("magichook")
local rope = Instance.new("RopeConstraint",magichookthing)
rope.Attachment0 = magichookthing.Attachment
rope.Attachment1 = attachment
end)
coroutine.resume(grappleright)
end)
The help would be appreciated, thanks!

2 comments
Error saying: Attachment must be parented to a PartInstance
My mind read attachment.Position as attachment.Parent, but it is fixed now.