llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 26 Jul 2016 08:08 PM |
local scool = false function shoot() if equipped == true then -- if scool then print 'cooling down' return end --scool = true print 'shot' local ray = Ray.new(currpri[1].SmokePart.CFrame.p, (mouse.Hit.p - currpri[1].SmokePart.CFrame.p).unit * 300) local part, position = workspace:FindPartOnRay(ray, plr.Character, false, true) local b = Instance.new("Part",game.Workspace)--Bullet b.Size = Vector3.new(1.42, 0.4, 0.4) b.Position = currpri[1].SmokePart.Position b.CanCollide = false b.CFrame = b.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(20),0,0) local bv = Instance.new("BodyVelocity",b) bv.Velocity = char.Torso.CFrame.lookVector * 100 local distance = (currpri[1].SmokePart.CFrame.p - position).magnitude b.CFrame = CFrame.new(currpri[1].SmokePart.CFrame.p, position) * CFrame.new(0, 0, -distance / 2) -- b.Position = Vector3.new() end end
now the part spawns at the mouse position what do
r+://290739801r+://290739819r+://290739831 R$1,248 (づ ゚ ³ ゚)づ |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 26 Jul 2016 08:31 PM |
how to make part go from smokepart tomouse position!!!
r+://290739801r+://290739819r+://290739831 R$1,248 (づ ゚ ³ ゚)づ |
|
|
| Report Abuse |
|
|
Dominical
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 1303 |
|
|
| 26 Jul 2016 08:35 PM |
Lol be more specific. No one here knows what you're talking about.
|
|
|
| Report Abuse |
|
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
| |
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
|
| 26 Jul 2016 08:42 PM |
local ray = Ray.new(currpri[1].SmokePart.CFrame.p, (mouse.Hit.p - currpri[1].SmokePart.CFrame.p).unit * 300) local part, position = workspace:FindPartOnRay(ray, plr.Character, false, true) local distance = (currpri[1].SmokePart.CFrame.p - position).magnitude local b = Instance.new("Part",game.Workspace)--Bullet b.Anchored = true b.Size = Vector3.new( 0.4, 0.4, distance) b.Position = currpri[1].SmokePart.Position b.CanCollide = false b.CFrame = b.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(20),0,0) game.Debris:AddItem(b, .1)
b.CFrame = CFrame.new(currpri[1].SmokePart.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
|
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 27 Jul 2016 12:50 AM |
i wish i saw this earlier
i im not trying to makea ray
im trying to manipulate the ray to shoot bullets towards the mouse
r+://290739801r+://290739819r+://290739831 R$1,294 (づ ゚ ³ ゚)づ |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 12:53 AM |
bullet.CFrame = CFrame.new(muzzle.Position,mouse.Hit.p)
while bullet do wait() local r = Ray.new(bullet.Position,bullet.lookVector*10)
local hit,pos = game.Workspace:FindPartOnRay(r)
if hit then
--DO STUFF bullet:remove()
end end end |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2016 12:53 AM |
oh and also, forgot to add this
bullet.CFrame = bullet.CFrame + bullet.lookVector*10
after making the raycast |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 27 Jul 2016 12:58 AM |
oh i got it now
i needed to change the the bullets CFrame
thanks daily
qq
r+://290739801r+://290739819r+://290739831 R$1,294 (づ ゚ ³ ゚)づ |
|
|
| Report Abuse |
|
|