Projectile not throwing

Im trying to create a spirit bomb from dragon ball and I fire a remote event to add a body velocity to throw it by the server and the body velocity is never added to the part. I’ve made sure that I sent the parent to explosion. I also keep getting on

Local script

--// Servies
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

--// Instances
local player = game.Players.LocalPlayer
local Character = player.Character
local humanoid = Character.Humanoid
local animator = humanoid.Animator
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage.Remotes:WaitForChild("SpiritBomb")
local face = require(game.ReplicatedStorage.Modules.FaceMouseModule)
local HumanoidRootPart = Character.HumanoidRootPart
local camera = workspace.CurrentCamera
local Charging = animator:LoadAnimation(RS.Assests.Animations.Charging)
local Bomb = RS.Assests.Effects.Spirit:Clone()


 
--// Modules
local VFXHandler = require(game.ReplicatedStorage.Modules.VFXHandler)
local soundmodule = require(game.ReplicatedStorage.Modules.SoundModule)
local face = require(game.ReplicatedStorage.Modules.FaceMouseModule)
local camshaker = require(RS.Modules.CameraShaker)
local RocksModule = require(RS.Modules.RocksModule)
local zc = require(RS.Modules.ZonitoCurves)
local VFXHelp = require(RS.Modules.VFXHelp)


local camShake = camshaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
	camera.CFrame = camera.CFrame * shakeCFrame
end)

camShake:Start()

local function ColorCorrectionEffect(SaturationStart:Number, ContrastStart:Number, SaturationEnd:Number, ContrastEnd:Number, DelayTime:Number, Duration:Number)
	--// Create a new ColorCorrectionEffect
	local ColorCorrection = Instance.new('ColorCorrectionEffect')
	ColorCorrection.Saturation = SaturationStart
	ColorCorrection.Contrast = ContrastStart
	ColorCorrection.Parent = game:GetService('Lighting')

	--// Apply the effect and clean up after the specified duration
	task.delay(DelayTime, function()
		ColorCorrection.Saturation = SaturationEnd
		ColorCorrection.Contrast = ContrastEnd

		task.wait(Duration)
		ColorCorrection:Destroy()
	end)
end
--ColorCorrectionEffect(-1, -3, -1, 3, 0.04, 0.04)

local function EmitAll(Parent: Instance)
	for _, v in Parent:GetChildren() do
		if v:IsA("ParticleEmitter") and v:GetAttribute("EmitCount") then
			task.delay(v:GetAttribute("EmitDelay"), function()
				v:Emit(v:GetAttribute("EmitCount"))
			end)
		end
	end
end


local function ToggleAll(Parent: Instance, Value: boolean, Switch: boolean, IncludeBeams: boolean)
	for _, v in Parent:GetChildren() do
		if v:IsA("ParticleEmitter") then
			if Switch then
				v.Enabled = not v.Enabled
			else
				v.Enabled = Value
			end
		end
		if IncludeBeams and (v:IsA("Beam")) or (v:IsA("Trail")) then
			if Switch then
				v.Enabled = not v.Enabled
			else
				v.Enabled = Value
			end
		end
	end
end

local function flyingrocks(HumanoidRootPart, IgnoreList)
	VFXHandler.FlyingRocks{
		i = 2; -- first loop
		j = 5; -- nested loop
		Offset = 10; -- radius from starting pos
		Origin = HumanoidRootPart.Position; -- where to start
		Filter = IgnoreList; -- filter raycast
		Size = Vector2.new(1,3); -- size range random from 1,3 
		AxisRange = 80; -- velocity X and Z ranges from (-AxisRange,AxisRange)
		Height = Vector2.new(50,60); -- velocity Y ranges from X,Y
		Percent = 0.65; -- velocity * percent of nested loop
		Duration = 2; -- duration of the debris rock
		IterationDelay = 0; -- delay between each i loop
	}
end




UIS.InputBegan:Connect(function(input,gpe)
	if gpe then return end
	if input.KeyCode == Enum.KeyCode.Q then
		local infnum = math.huge
		local mousepos = mouse.Hit
		local info = TweenInfo.new(
			3,
			Enum.EasingStyle.Sine,
			Enum.EasingDirection.In,
			0,
			false,
			0
		)


		local tween = TweenService:Create(HumanoidRootPart,info,{Position = HumanoidRootPart.Position + HumanoidRootPart.CFrame.UpVector * 57})
		HumanoidRootPart.Anchored = true
		tween:Play()
		task.wait(3)
		Charging:Play()
		local info2 = TweenInfo.new(
			7,
			Enum.EasingStyle.Sine,
			Enum.EasingDirection.Out,
			0,
			false,
			0
		)
		Bomb.Parent = workspace.FX
		Bomb.CFrame = HumanoidRootPart.CFrame * CFrame.new(0,57,0)
		local tween2 = TweenService:Create(Bomb,info,{Size = Vector3.new(104, 104, 104)})
		tween2:Play()
		remote:FireServer(mousepos,mouse.Hit.p)
	end
end)



Server script

local RS = game:GetService("ReplicatedStorage")

local Visual = workspace.FX
local Live = workspace.World.Live
local Replicate = RS.Remotes:WaitForChild("SpiritBomb")


local VFXHandler = require(RS.Modules.VFXHandler)
local KnockBackModule = require(RS.Modules.Knockback)
local Bomb = RS.Assests.Effects.Spirit:Clone()








Replicate.OnServerEvent:Connect(function(Player,mouseaim)
	local plrCharacter = Player.Character
	local Humanoid = plrCharacter:FindFirstChild("Humanoid")
	local HumanoidRootPart = plrCharacter:FindFirstChild("HumanoidRootPart")
	local mouse = Player:GetMouse()
	
	

	
	local bodyVelocity = Instance.new("BodyVelocity")
	bodyVelocity.Parent = Bomb
	bodyVelocity.Velocity = CFrame.new(HumanoidRootPart.Position,mouseaim).LookVector * 30
	bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)	
	
end)
1 Like

This is the problem. You are cloning the bomb separately on both the client and server, so they each have different copies of it. You need to create the bomb on the server.

youre passing in mouseaim which is a cframe to cframe.new, which should be a vector3