Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my Ki blast spawn in a different location and not my torso? *SOLVED*

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)




1 answer

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.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)

I have changed line 7 from kiblast to newKiBlast, since you were previously changing the position of the part in serverstorage, and not the one in workspace.

Hope this helps!

2 comments

0

Thx for helping but sadly it didn't work. :/

0

So I changed it but, it comes out of my back and then it just falls down like it doesn't even move.

This discussion is preserved as it was. New answers, comments, and votes are closed.