Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How to fix Raycasting script not dealing damage ?

Asked by 5 years ago

Theres not much to explain the title pretty much sums it up but heres the script

01function fireBullet(start, target, maxLength)
02    --settings some constants
03    local directionVector = (target - start).unit
04    local direcitonCFrame = CFrame.new(start, start + directionVector)
05    --settings values that we're going to update throughout
06    local delta, lastTick, startTime = 0, tick(), tick()
07    local hit, position, lastPosition = nil, target, start
08    local totalDistance = 0
09    local function loop()
10        local ignore2 = {
11         character;
12         M4;
13         camera;
14         }
15        while not hit and totalDistance < maxLength do --basically stop if we hit our max or we hit something
View all 67 lines...
0
Do you actually define handleBulletHit after Line 36 or have you moved the function from somewhere while posting this script? Ankur_007 290 — 5y
0
This is pretty advanced script. I'm sure you can be more specific about the issue, if you wrote it... sleazel 1287 — 5y
0
i moved it fortune80 -4 — 5y
0
sorry if it is not clear enough but what im trying to say is for some reason is when it hits damage is not being dealt fortune80 -4 — 5y

Answer this question