I am trying to make a weapon (Light Orb, in my place Lights) with a raycasting area splash damage that damages all players except the client player within a certain distance. I have tried, but it failed completely. Here is the code, and here is the Layout also. Please help me, I am stuck and really confused >_<
local tool = script.Parent
local handle = tool.Handle
local light = handle.PointLight
local player = game.Players.LocalPlayer
local Enabled = true
local debounce = false
function activated()
if Enabled == true then
Enabled = false
wait()
local col = game.ServerStorage.collide:Clone()
col.Parent = tool
col.Position = handle.Position
col.Anchored = false
wait()
light.Brightness = 100
light.Range = 18
wait()
col.LocalSimulationTouched:connect(function(hit)
local ray = Ray.new(handle (360))
local ignore = game.Players.LocalPlayer.Character
local hit, position = Workspace:FindPartOnRay(ray, ignore)
end)
light.Brightness = 1
light.Range = 16
tool:FindFirstChild("collide"):Destroy()
wait(.2)
Enabled = true
end
end
script.Parent.Activated:connect(activated)

1 comment
Hrng. I just remembered something that works better fir this situation called Region3.