#Raycast shotgun Help

55 messages · Page 1 of 1 (latest)

sage tusk
#

you are trying to assign a cframe value where it should be a vector3 one

#

im not really sure where but try checking rayOrigin and rayDirection as they both need to be vector3 values

#

hm

#

yes it is rayDirection your problem

#

it’s on cframe but it needs to be vector3

#
 local rayDirection = (CFrame.new(rayOrigin,mousePosition) * CFrame.Angles(math.random() * spread, math.random() * spread, math.random() * spread)).LookVector * 50```
#

doing .LookVector should probably fix your problem

#

like above

elfin ice
#

wait

#

its going in like

#

nvm

elfin ice
#

completely off

sage tusk
#

?

elfin ice
#

lemme give a video hol dup

#

i want it to shoot like a shotgun

#

not like

#

go EVERYWHERE

#

ok i go tthe spread part @sage tusk

#

how could i make it actualyl shoot like a shotgun now?

sage tusk
#

try lowering the math.random values

elfin ice
#

the spread works

#

perfectly now

sage tusk
#

nice

elfin ice
#

i lowered it to .15

#

so how

#

could i

#

make multiple rays

#

i have it in a for loop

#

idk

sage tusk
#

just loop it

elfin ice
#

im trying

#

it takes very long to shoot when i do

#

between shots*

#

so like

#

lemme show you

sage tusk
#

hm

fossil umbraBOT
#

studio** You are now Level 2! **studio

elfin ice
#

idk bruh

#

how do i make

#

the loop run at the same time

#

its like its

#

completely going through the script

#

then looping it once its done

#

then so on

#

im using for lua count = 1,8 do

sage tusk
#

you can do

#

spawn()

elfin ice
#

what

sage tusk
#
for count = 1,8 do
spawn(function()
— code here
end)
end```
elfin ice
#

thanks for your help

sage tusk
#

nice