This is the script basically i'm trying to make the knife go to the position of the mouse


game:GetService("ReplicatedStorage").OHKnife.OnServerEvent:Connect(function(player)
if player.Data.Stand.Value == 13 or player.Data.Stand.Value == 10005 or player.Data.Stand.Value == 1007 or player.Data.Stand.Value == 1005 or player.Data.Stand.Value == 666 then
local chr = player.Character
local mouse = player:GetMouse()
local rtzevent = game.ReplicatedStorage.RTZClient
local rarm = chr["Right Arm"]
local hed = chr["Head"]
local knife = game.ServerStorage.OHKnife
thrown = true
local projectileknife = knife:Clone()
projectileknife.Parent = game.Workspace.Effects
	
projectileknife.CFrame = chr.HumanoidRootPart.CFrame * cf(1, 0, -3) * ang(rd(-90), rd(0), rd(0))
projectileknife:SetNetworkOwner(nil)
local boopyve = Instance.new("BodyVelocity")
boopyve.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
boopyve.P = math.huge
boopyve.Velocity = mouse.Hit.p
boopyve.Parent = projectileknife
boopyve.Name = "Force"

1 comment

0

The player's mouse can only be obtained on their client. Instead, you can get the player's mouse on the client and send the mouse hit property to the server through the remote event.