Ive tried changing a few things around but its not working still, any help would be appreciated.
Error Message:
Workspace.Modules.RayPhoto:19: attempt to index nil with number - Server - RayPhoto:19
Line 19:
Temp[1] = Vector3.new(StartPos.X,StartPos.Y,StartPos.Z)
The script (Up to point of ray firing)
local RayCasting = require(game.Workspace.Modules.RayCasting)
local CFModule = require(game.Workspace.Modules.CFModule)
local Temp = nil
local RayPhoto = {}
function RayPhoto.TakePhoto(StartPos,Distance,Inc,LoopTime)
StartPos = CFrame.new(StartPos.X,StartPos.Y,StartPos.Z)
print("StartPos")
print(StartPos)
print(StartPos + StartPos.LookVector * Distance)
local RealValues = {360,360,360}
local TempValues = {360,360,360}
local Pos = {}
while TempValues[1] > 0 do
while TempValues[2] > 0 do
while TempValues[3] > 0 do
Temp[1] = Vector3.new(StartPos.X,StartPos.Y,StartPos.Z)-- <---
Temp[2] = StartPos + StartPos.LookVector * Distance
Temp[2] = Vector3.new(Temp[2].X,Temp[2].Y,Temp[2].Z)
local Result = RayCasting.FireRay(Temp[1],Temp[2])