#i have a problem with projectile
1 messages · Page 1 of 1 (latest)
can i see the script? @barren linden
@keen kayak
try this local Pistola = script.Parent
Pistola.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
local Bullet = Pistola.Handle.Bullet1:Clone()
Bullet.Anchored = false
Bullet.CanCollide = true
Bullet.Parent = workspace
local UscitaProiettile = Pistola.Handle:FindFirstChild("UscitaProiettile")
if UscitaProiettile then
Bullet.CFrame = UscitaProiettile.CFrame * CFrame.new(0, 0, -1)
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.Velocity = UscitaProiettile.CFrame.LookVector * 500
bodyVelocity.MaxForce = Vector3.new(1e5, 1e5, 1e5)
bodyVelocity.Parent = Bullet
end
local Danno = 100
Bullet.Touched:Connect(function(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid:TakeDamage(Danno)
Bullet:Destroy()
end
end)
game.Debris:AddItem(Bullet, 2)
end)
end)
local Pistola = script.Parent
Pistola.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
local Bullet = Pistola.Handle.Bullet1:Clone()
Bullet.Anchored = false
Bullet.CanCollide = true
Bullet.Parent = workspace
local UscitaProiettile = Pistola.Handle:FindFirstChild("UscitaProiettile")
if UscitaProiettile then
Bullet.CFrame = UscitaProiettile.CFrame * CFrame.new(0, 0, -1)
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.Velocity = UscitaProiettile.CFrame.LookVector * 500
bodyVelocity.MaxForce = Vector3.new(1e5, 1e5, 1e5)
bodyVelocity.Parent = Bullet
end
local Danno = 100
Bullet.Touched:Connect(function(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid:TakeDamage(Danno)
Bullet:Destroy()
end
end)
game.Debris:AddItem(Bullet, 2)
end)
end)
bro with this script when i shot they do an mega jump
that would be because you are using a part
with physics
that is a static image
so what i can use to not use a part?
singular raycast if you don't care about size, drop, or speed
sequential raycast (ft. deltatime) if you care about speed and drop but not size
sequential shapecast/boxcast/spherecast if you care about size, drop, and speed, or even the exact shape
okok
** You are now Level 2! **
thanks
Don’t use this
So what i have tò use?
Knowledge
Where i can learn
You read the documentation
Can you link It? Please