-
What do you want to achieve?
I want my laser, not through a wall, it looks like laser cheating, I need you guys to help me fix this bug, it’s making me crazy -
What is the issue?
Here is video about that bug:
I dont want it not go though wall like this, it looking very bad
Here is that bug, please help me it
-
What solutions have you tried so far?
I had trying to add more some script or deleted a bit script but it not working, here is what script have, please help edit it more or add more a bit script to remvoe this or guide me fix this on chat
Control
wait(0)
local Tool = script.Parent
Handle = Tool.Handle
function Playerget()
N=Tool.Parent.Name
F=Game.Players:findFirstChild(N)
return F
end
function NewLazer(Pos1,Pos2)
P=Instance.new("Part")
P.Name = "Lazer"
P.BrickColor = BrickColor.new("Persimmon")--Control the color here
P.Transparency= 0.7
P.Anchored = true
P.CanCollide = false
P.CanTouch = false
P.CanQuery = false
P.CastShadow = false
P.Material = Enum.Material.Neon
P.formFactor = 0
P.Size = Vector3.new(0.005,0.005,(Pos1-Pos2).magnitude)
P.CFrame = CFrame.new((Pos1+Pos2)/2,Pos1)+Vector3.new(0,0,0)
M=Instance.new("BlockMesh")
M.Scale = Vector3.new(0.03,0.03,1)
M.Parent=P
P.Parent = Tool.Spam
return P
end
function Point(mouse)
X = string.sub(mouse.Hit.X,1,4)
Y = string.sub(mouse.Hit.Y,1,4)
Z = string.sub(mouse.Hit.Z,1,4)
Compile = Vector3.new(X,Y,Z)
Lazer = NewLazer(Compile,Handle.Position)
while true do
X = string.sub(mouse.Hit.X,1,4)
Y = string.sub(mouse.Hit.Y,1,4)
Z = string.sub(mouse.Hit.Z,1,4)
Compile = Vector3.new(X,Y,Z)
Lazer.Size = Vector3.new(1,1,(Compile-Handle.Position).magnitude)
Lazer.CFrame = CFrame.new((Compile+Handle.Position)/2,Compile)+Vector3.new(0,0,0)
wait(0)
end
end
function EQuip(mouse)
if(mouse~=nil)then
Point(mouse)
end
end
Tool.Equipped:connect(EQuip)
Cleaner
wait(0)
local Tool = script.Parent
function DeQuip()
Spam=Tool.Spam:GetChildren()
for i=1,#Spam do
Spam[i]:Remove()
end
end
Tool.Unequipped:connect(DeQuip)