I can easily go on the wiki to find raycasting laser guns for players but I wanted to create a ray from an npc to its target. This is my script so far. The Scripters Forum is answering every one else's question except for mine. Please karma just help me.
while true do
wait(.1)
local target = findNearestTorso(script.Parent.Torso.Position)
if target ~= nil then
script.Parent.Torso.CFrame = (CFrame.new(script.Parent.Torso.Position,
Vector3.new(target.Position.X, script.Parent.Torso.Position.Y, target.Position.Z)))
-- make the ray here so every .1 seconds it shoots a ray at its target.
end
I really need help. Please take the time and help me ! |