local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
enabled = true
Mouse.KeyDown:connect(function(key)
if not enabled then
return
end
if key == "z" then
local Shot = Instance.new("Part", workspace)
Shot.Name = "RayPart"
Shot.BrickColor = BrickColor.new("Bright red")
Shot.Transparency = 0
Shot.Anchored = false
Shot.CanCollide = false
Shot.TopSurface = Enum.SurfaceType.Smooth
Shot.BottomSurface = Enum.SurfaceType.Smooth
Shot.formFactor = Enum.FormFactor.Custom
Shot.Size = Vector3.new(5, 5, 5)
Shot.CFrame = Player.Character.Torso.CFrame*CFrame.new(0,0,0)
local Woosh = Instance.new("BodyPosition")
Woosh.maxForce = Vector3.new(math.huge, math.huge, math.huge)
Woosh.position = Vector3.new(Mouse.Hit)
Woosh.Parent = Shot
end
end)
This is meant to fire the "Shot" Part from my torso and to wherever my mouse is pointing, however it fires to the middle of the baseplate and I have no idea why. The output doesn't say anything. Please help.
