I'm working on a game and there's only one problem: the bullet is facing the wrong direction. This means Holes won't work properly. here]s some details.
Client:
local Start = Weapon.Shoot.CFrame.p
local SD = math.ceil(((Start-Mouse.Hit.p).magnitude/25) + .5)
local SX = math.random(-SD,SD)
local SY = math.random(-SD,SD)
local SZ = math.random(-SD,SD)
local ShotgunDirection = Settings.ShotgunMode and Vector3.new(SX/2.75,SY/2.75,SZ/2.75) or Vector3.new(0,0,0)
local Direction = (Mouse.Hit.p-Weapon.Shoot.CFrame.p + ShotgunDirection).unit
local BulletRay = Ray.new(Start,Direction * Settings.Range)
table.insert(Rays,BulletRay)
Server:
local Distance = (Start-Position).magnitude
local Bullet = Instance.new("Part",workspace.World.DebrisItems)
Bullet.Name = Player.Name.."'s Bullet"
Bullet.Anchored,Bullet.CanCollide = true,false
Bullet.Transparency = .4
Bullet.BrickColor = BrickColor.new("Institutional white")
Bullet.Material = Enum.Material.Neon
Bullet.Size = Vector3.new(.1,.1,2)
Bullet.CFrame = CFrame.new(Start,Position)
local Info = TweenInfo.new(Distance/Settings.BulletSpeed,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
PlayModule:PlayTween(Info,Bullet,{Transparency = 1})
if Settings.AnimateBullet then
PlayModule:PlayTween(Info,Bullet,{CFrame = Bullet.CFrame * CFrame.new(0,0,-Distance/2)})
else
Bullet.CFrame = Bullet.CFrame * CFrame.new(0,0,-Distance/2)
Bullet.Size = Vector3.new(.1,.1,Distance)
end

1 comment
Oh ok thanks