#Localscript
The bullet wont even shoot from the correct target (EarthPart) in workspace. Why??
local Target = Mouse.Target
local Dist = ((Target.Position-EarthPart.Position).magnitude)
local Bullet = Create'Part'{BrickColor=BrickColor.new('New Yeller'),Parent=EarthPart,Name='Bullet',Anchored=true,CanCollide=false,Locked=true,FormFactor='Custom',Size=Vector3.new(.2,Dist,.2)}
Bullet.CFrame = CFrame.new(EarthPart.Position,Target.Position)
* CFrame.new(0,-Dist,0)
local GunSound = Instance.new("Sound",workspace) GunSound.Pitch = 1 GunSound.Volume = 1 GunSound.Looped = false GunSound.SoundId = "rbxassetid://132456235"
GunSound:Play()
for i = 0,1.1 do
Bullet.Transparency = Bullet.Transparency + .1
Services.run.RenderStepped:wait()
end
Bullet.Touched:connect(function(obj)
if obj.ClassName == 'Model' then
if obj:FindFirstChild('Humanoid',true) then
obj.Humanoid.Health = obj.Humanoid.Health - 15
end
end
end)
Bullet:remove()

1 comment
Thanks!