|
| 12 Dec 2016 04:44 PM |
| Are there any examples of how to find the proper ballistics bullet travel? With angle of course. |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Dec 2016 04:47 PM |
1. I doubt they they would have accurate anything 2. I'm looking for more math sided instead of "here it is" lua code |
|
|
| Report Abuse |
|
|
Pxkez
|
  |
| Joined: 24 Sep 2015 |
| Total Posts: 1066 |
|
|
| 12 Dec 2016 04:48 PM |
search "Dot Product" on roblox wiki
~Help me u dirty cookie |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2016 04:52 PM |
| Well I know i can get the angle from that, thanks actully. I have no idea how to incorporate it though. |
|
|
| Report Abuse |
|
|
Pxkez
|
  |
| Joined: 24 Sep 2015 |
| Total Posts: 1066 |
|
|
| 12 Dec 2016 04:55 PM |
local tool = script.Parent local handle = tool:WaitForChild("Handle") function reflect(input, normal) -- using dot method b/c vector3 return -2 * input:Dot(normal) * normal + input end function drawray(ray, parent) local part = Instance.new("Part") part.Material = Enum.Material.Neon part.Size = Vector3.new(.2, .2, ray.Direction.magnitude) part.CFrame = CFrame.new(ray.Origin + ray.Direction/2, ray.Origin + ray.Direction) part.Anchored = true part.CanCollide = false part.BrickColor = BrickColor.new("Bright red") part.Parent = parent or game.Workspace.CurrentCamera return part end function fire(from, to, bounce) local bounce = bounce or 0 if bounce <= 5 then -- how many times can it reflect -- first ray is to calculate distance and normal local ray = Ray.new(from, (to - from).unit * 500) local hit, pos, normal = ga#################################o############ -- this is the actual ray we use and draw local ray2 = Ra####################rom)) local part = drawray(ray2, tool) -- throw out the laser beam later game:GetService("Debris"):AddItem(part, 2) -- calculate the reflected ray local ref = reflect((pos - from), normal) if hit then local hum = hit.Parent:FindFirstChild("Humanoid") if hum then hum:TakeDamage(math.random(10, 15)) end -- shoot a ray in the reflected position fi#########o### ref, bounce + 1) end end end script.Parent.Equipped:connect(function(mouse) mouse.TargetFilter = game.Workspace script.Parent.Activated:connect(function() fire(handle.CFrame.p, mouse.Hit.p) end) end)
this was on the wiki, if u want it to reflect only once then just make sure it doesnt run "fire" twice
~Help me u dirty cookie |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2016 05:01 PM |
| I don't think you know what Im talking about, because I dont actually want it to bounce. |
|
|
| Report Abuse |
|
|
Pxkez
|
  |
| Joined: 24 Sep 2015 |
| Total Posts: 1066 |
|
|
| 12 Dec 2016 05:09 PM |
oh, how to find it?
~Help me u dirty cookie |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2016 05:24 PM |
| #################################################################################################################################################################################################################################################### |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2016 05:24 PM |
| ###################################################################################################################################################################################### |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2016 06:31 PM |
Run this code in any server script
pastebin / 8BqfGRVG |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2016 06:35 PM |
Have a look at VolcanoINC's ProjectileLibrary.
https://www.roblox.com/library/370071622/ProjectileLib |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Dec 2016 06:48 PM |
| Create a formula and plug in values, like in math class. |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2016 07:07 PM |
| Well I mean that is the obvious goal lmao. The problem is how to manipulate those values |
|
|
| Report Abuse |
|
|