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

Why is this script just putting a ki blast in the middle of the map?

 kblast = script.Parent
 player = game.Players.LocalPlayer
mouse = player:GetMouse()
function fireblast()
	local ki = Instance.new("Part", workspace)
	game.Debris:AddItem(ki,4)
	ki.Shape = ("Ball")
	ki.Material = ("Neon")
	ki.Size = Vector3.new(1,1,1)
	ki.TopSurface = ("Smooth")
	ki.BottomSurface = ("Smooth")
	ki.Transparency = (0.6)
	ki.BrickColor = BrickColor.new("Toothpaste")
	ki.Anchored = true
	ki.CanCollide = false
	ki.Name = ("KiBlast")
	
	
	
	ki.CFrame = CFrame.new(ki.Position,mouse.hit.p)
	print("ki blast launched")
	
	local vel = Instance.new("BodyVelocity")
	vel.Velocity = ki.CFrame.lookVector * 90
	vel.maxForce = Vector3.new(math.huge,math.huge,math.huge)
	vel.Parent = ki
	
	local spark = Instance.new("Sparkles", ki)
	
	
	
end

kblast.Activated:connect(fireblast)

2 answers

✓ Accepted answer

It doesn't look like you assign its Position or CFrame at all. You can do that by doing something like this:

kblast = script.Parent
 player = game.Players.LocalPlayer
 --[[ new thing woo --]]
local character = player.Character
if not character then
character = player.CharacterAdded:wait()
end
character = player.Character
 --[[ new thing woo --]]
mouse = player:GetMouse()
function fireblast()
    local ki = Instance.new("Part", workspace)
    game.Debris:AddItem(ki,4)
    ki.Shape = ("Ball")
    ki.Material = ("Neon")
    ki.Size = Vector3.new(1,1,1)
    ki.TopSurface = ("Smooth")
	-- [[ NEW PART HERE TOO WHOOOOOOOOO BOY --]]
ki.CFrame = character.LeftArm.CFrame
     -- [[ NEW PART HERE TOO WHOOOOOOOOO BOY --]]
   
    ki.BottomSurface = ("Smooth")
    ki.Transparency = (0.6)
    ki.BrickColor = BrickColor.new("Toothpaste")
    ki.Anchored = true
    ki.CanCollide = false    ki.Name = ("KiBlast")
    ki.CFrame = CFrame.new(ki.Position,mouse.hit.p)
    print("ki blast launched")
    local vel = Instance.new("BodyVelocity")
    vel.Velocity = ki.CFrame.lookVector * 90
    vel.maxForce = Vector3.new(math.huge,math.huge,math.huge)
    vel.Parent = ki
    local spark = Instance.new("Sparkles", ki)
end
kblast.Activated:connect(fireblast)

Have you set the KiBlast.Position? The position should be the character's position plus a few bits foward so it comes from the front.

Also, if this is a DBZ game, Good luck!

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