So I have this local script
local tool = script.Parent
local user
tool.Equipped:connect(function(mouse)
user = tool.Parent
mouse.Button1Down:connect(function()
local ray = Ray.new(tool.Barrel.CFrame.p, (mouse.Hit.p - tool.Barrel.CFrame.p).unit*300)
local hit, position = game.Workspace:FindPartOnRay(ray, user)
local distance = (position - tool.Barrel.CFrame.p).magnitude
print(position)
script.Parent.Fire:FireServer(hit, Vector3.new(position), distance)
end)
end)
and I have this server script
script.Parent.Fire.OnServerEvent:Connect(function(hit, position, distance)
print(position)
(I’ve not put in all of it) but I pass through a Vector3 (position) but in the server it thinks it’s a object.
This is the output
4.58224392, 2.59595466, 73.4553146
Body
Does Anyone know how to fix this?