You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to fix a little issue on my raycasting code that im using to make a mine/claymore thing in my game, the basic raycast works, if the raycast detects something in the radius , its gonna blow up, but the damaging part dont works, keep in mind i just started to learn raycasting. -
What is the issue? Include screenshots / videos if possible!
The raycast cant get the parent of what it hits, making damaging a player with it not possible
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Tried changing a few parts in the script but nothing worked, and devforum is always a helping hand.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
while wait(0.1) do
local Hit, Position = game.Workspace:Raycast(Part.Position,Vector3.new(0,20,0))
if Hit then
wait(0.2)
print(Hit)
local Hit2, Position = game.Workspace:Raycast(Part.Position,Vector3.new(40,40,40))
beep:Play()
weak.Enabled = true
strong.Enabled = true
effect.Enabled = true
lig.Enabled = true
ligc.Enabled = true
ligc2.Enabled = true
light.Enabled = true
script.Parent.Dist1:Play()
wait(0.1)
weak.Enabled = false
strong.Enabled = false
effect.Enabled = false
lig.Enabled = false
ligc.Enabled = false
ligc2.Enabled = false
light.Enabled = false
if Hit2 ~= nil then
wait(0.2)
if Hit2.Parent:FindFirstChild("Humanoid") then
Hit2.Parent.Humanoid:TakeDamage(180)
end
end
wait(0.5)
script.Parent.Transparency = 1
script.Parent.CanCollide = false
wait(0.3)
script.Parent.Explode.Value = true
script.Parent:Destroy()
end
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.