output:ServerScriptService.Script:10: invalid argument #1 to ‘lookAt’ (Vector3 expected, got Instance)
what i want: the ball goes to where your mouse it as
script:
local rep = game:GetService("ReplicatedStorage")
local rem = rep:WaitForChild("RemoteEvent")
local storage = game:GetService("ServerStorage")
local clone = storage:WaitForChild("Part"):clone()
local speed = 10
rem.OnServerEvent:Connect(function(plr,MouseHit)
local char = plr.Character or plr.CharacterAdded:Wait()
local humrp = char:WaitForChild("HumanoidRootPart")
local bv = Instance.new("BodyVelocity")
clone.CFrame = CFrame.lookAt(humrp,MouseHit)
bv.Velocity = clone.CFrame.lookVector * speed
bv.Parent = clone
clone.Parent = game.Workspace
end)
local script:
local rep = game:GetService("ReplicatedStorage")
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local rem = rep:WaitForChild("RemoteEvent")
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input,istyping)
if istyping then return end
if input.KeyCode == Enum.KeyCode.E then
rem:FireServer(mouse.Hit.p)
end
end)