I make a shuriken that is fired when i press a button But when i shoot it is isn't riight is has a little offset on route. Shuriken Script :

--Made by tecady2111--
----------------------------------------Declaring Variables--------------------------------
-------------------------------------------------------------------------------------------
local disappear = 0.75
local damage = 2.5
local key = 'e' 
local speed = 200
local debounce = false
local player = game.Players.LocalPlayer 
local Character = player.Character 
local Mouse = player:GetMouse()
local humanoid = player.Character:FindFirstChild("Humanoid")
local ButtonDown = false

-------------------------------------------------------------------------------------------
 
function onKeyDown(keyx) 
	if keyx == key:lower()   then
		ButtonDown = true		
		local size = 15	
		local size2 = 2
		x = script.Star:clone()
		x.Parent = player.Character.Torso
		x.Size = Vector3.new(size,size,size)
		x.Anchored = true
		while ButtonDown == true do
			x.Size = Vector3.new(size2,size2,size2)
			x.CFrame = player.Character.Torso.CFrame*CFrame.new(0,5,0)
			wait()
		end		
		x.Anchored = false		
		x.CFrame = player.Character.Torso.CFrame*CFrame.new(0,0,-3)
		x.Mesh.Scale = Vector3.new(size*3,size*3,size*3)
		x.Spin.Disabled = false
		local bv=Instance.new("BodyVelocity",x)
		bv.maxForce=Vector3.new(math.huge,math.huge,math.huge)
		bv.velocity=x.CFrame.lookVector*120	
		--Damage part--
		x.Touched:connect(function(Part)
			if Part.Parent:findFirstChild("Humanoid") and Part.Parent.Name ~= player.Name then
				Part.Parent.Humanoid:TakeDamage(damage)
	
			end
	end) 
  end
end 
Mouse.KeyDown:connect(onKeyDown)
function onKeyUp(keyx)
	ButtonDown = false
end
Mouse.KeyUp:connect(onKeyUp)

--Made by tecady2111--



And the spining effect for the shuriken

spinning = script.Parent

while true do
spinning.CFrame = spinning.CFrame * CFrame.Angles(0,10,0)
wait(0.00)
end

2 comments

0

Line 32 "x.CFrame = player.Character.Torso.CFrame*CFrame.new(0,0,-3)"

0

what is with it?