For some reason .Touched lags my game when there is multiple beams fired and when it touched character, the character start lagging on there client side. Heres the server script code on remote function or touch interest
part1.Touched:connect(function(touched)
if touched~= nil then
if touched.Parent then
if touched.Parent:FindFirstChild("Humanoid")~= nil then
if touched.Parent.Name ~= char.Name then
if touched.Parent:FindFirstChild("Kamehamehad")== nil then
damage = 2
if char:FindFirstChild("SSJ")~= nil then
damage = damage + 1
end
if char:FindFirstChild("SSJ2")~= nil then
damage = damage + 1.5
end
if char:FindFirstChild("SSJ3")~= nil then
damage = damage + 2
end
if char:FindFirstChild("SSJB")~= nil then
damage = damage + 2.5
end
if char:FindFirstChild("LIMIT")~= nil then
damage = damage + 3
end
if touched.Parent:FindFirstChild("Block") == nil then
touched.Parent:FindFirstChild("Humanoid").Health = touched.Parent:FindFirstChild("Humanoid").Health - damage
else
touched.Parent:FindFirstChild("Humanoid").Health = touched.Parent:FindFirstChild("Humanoid").Health - (damage/1.2)
end
km = Instance.new("StringValue",touched.Parent)
km.Name = "Kamehamehad"
game.Debris:AddItem(km,0.1)
end
end
end
end
end
end)

8 comments
Err: Could not read code - Didn't indent propely... ErrCode: #EF0AA4F
what is this absolutely random indenting
Talking about his indenting instead of helping. Le classic.
im asking if theres another hit detection/.touched function other then touch interest
use magnitude
magnitude is good but how to i use it on all size of the part like is a part is V3.new(1,20,1) i ant to see if player is inside the block
20/10 = 10 so 10 studs right?
if you indent then indent correctly. If you don't indent at all, that is better than random indents. I don't know what in the world you do.