So I'm trying to make like a fireball or a ki blast but whenever I press "E" to spawn the ki blast it spawns somewhere else and not my in HumanoidRootPart pls help me
Here's my code:
local kiblast = game.ServerStorage.KiBlast:WaitForChild("KiBlastModel")
game.ReplicatedStorage.EnergyBlasts.KiBlast.KiBlastEvent.OnServerEvent:Connect(function(player,cframe)
local character = player.Character
local newKiBlast = kiblast:Clone()
kiblast.PrimaryPart.CFrame = character.HumanoidRootPart.CFrame
--newKiBlast.CFrame = character.HumanoidRootPart.CFrame
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bodyVelocity.Velocity = (character.HumanoidRootPart.CFrame.lookVector*120)
bodyVelocity.Parent = newKiBlast
newKiBlast.Parent = workspace
wait(5)
newKiBlast:Destroy()
end)
Thx
Nvm I solved it with some help from discord
local kiblast = game.ServerStorage.KiBlast:WaitForChild("KiBlastModel")
game.ReplicatedStorage.EnergyBlasts.KiBlast.KiBlastEvent.OnServerEvent:Connect(function(player,cframe)
local character = player.Character
local newKiBlast = kiblast:Clone()
--newKiBlast.CFrame = character.HumanoidRootPart.CFrame
print("Hi")
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bodyVelocity.Velocity = (character.HumanoidRootPart.CFrame.lookVector*120)
bodyVelocity.Parent = newKiBlast.PrimaryPart
--I need to change bodyVelocity.Parent = newKiBlast
--to bodyVelocity.Parent = newKiBlast.PrimaryPart
newKiBlast.Parent = workspace
newKiBlast.PrimaryPart.CFrame = character.HumanoidRootPart.CFrame
wait(5)
newKiBlast:Destroy()
end)

2 comments
Thx for helping but sadly it didn't work. :/
So I changed it but, it comes out of my back and then it just falls down like it doesn't even move.