#how do i do this
1071 messages · Page 2 of 2 (latest)
** You are now Level 4! **
its 4 am, i delegate the help to iQuadla
why do u want my place'
im too tired to help
just like i said reproduce
uhh ok
you hsoould sleep
yeah i just have to finish one thing
rest assured ill go to sleep as soon as i finish it
i found it somewhere else
you probably placed it somewhere while saving it as file
alr am gonna do smt
alright
most of the problem is in your raycast function
you're using attachment's local position instead of world position and you didn't include params in workspace:Raycast()
simply replace attachment position to attachment worldposition and include params in line 14
yeah ik
alr
so like this?
local params = RaycastParams.new()
params.FilterDescendantsInstances = {player.Character,gun}
params.FilterType = Enum.RaycastFilterType.Include
local result = workspace:Raycast(gun.Handle.Attachment.Position, CFrame.lookAt(gun.Handle.Attachment.WorldPosition, mouse.Hit.Position).LookVector * 1000)
return result
end```
replace the first argument too and put params in last argument
ohhh
so like this
local params = RaycastParams.new()
params.FilterDescendantsInstances = {player.Character,gun}
params.FilterType = Enum.RaycastFilterType.Exclude
local result = workspace:Raycast(gun.Handle.Attachment.WorldPosition, CFrame.lookAt(gun.Handle.Attachment.WorldPosition, mouse.Hit.Position).LookVector * 1000,params)
return result
end
yes
yay
good
u genius
ok am going to bed now there’s one more thing i wanted to do with the gun
to make it for when u click on nothing it still shoots a beam far out
i will try to do that tmr
or should i say today
cuz its 1 am
i will do it after i sleep
and a few other things after i finish sleeping
am back chat\
@primal hedge i need help
its the same problem but with the raycast nil thing
local raycast = Raycast()
print(raycast)
if raycast == nil then
local attachment0 = Instance.new("Attachment")
attachment0.Parent = workspace.Baseplate
attachment0.Name = "attachment0"
attachment0.WorldPosition = gun.Handle.Attachment.WorldPosition
local attachment1 = Instance.new("Attachment")
attachment1.Parent = workspace.Terrain
attachment0.Name = "attachment1"
attachment1.WorldPosition = CFrame.lookAt(gun.Handle.Attachment.WorldPosition, mouse.Hit.Position).LookVector * 150
local beam = Instance.new("Beam")
beam.Attachment0 = attachment0
beam.Attachment1 = attachment1
beam.Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 234, 3)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 247, 0)),
})
beam.LightEmission = 3 -- use additive blending
beam.LightInfluence = 1
beam.FaceCamera = true -- beam is visible from every angle
beam.Segments = 10 -- default curve resolution
beam.Enabled = true
beam.Parent = attachment0
beam.Width0 = 0.2
beam.Width1 = 0.2
local sound = Instance.new("Sound", game.SoundService)
sound.SoundId = "rbxassetid://1905367471"
sound.Volume = 0.5
sound:Play()
for i = 0, 1, 0.1 do
beam.Transparency = NumberSequence.new(i)
task.wait(0.03)
end
task.wait(0.3)
beam:Destroy()```
😭
wait
the same problem is happening again


omg guys i did it
i have such a big brain
i didnt need help
i figured it out myself
@dull dust
nice
@dull dust
is there a way i can still get the position of the raycast even if its nil?
@dull dust
@fals
omg i did it
bymyself again
u were right
googling does work
it does
cool
ok