|
| 20 Nov 2012 09:10 PM |
Nothing in output, And it makes the part, Just dosnt make it anywhere you can see it
function onTouch(part) Lazor = Ray.new(script.Parent.CFrame.p, (script.Parent.CFrame.p - script.Parent.CFrame.p).unit*300) hit, position = game.Workspace:FindPartOnRay(Lazor, script.Parent) --Raycasting end
--Damage start if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid"):TakeDamage(30) end --Damage end
--Part maker start Part = Instance.new("Part", workspace) Part.Name = "Lazor" Part.BrickColor = BrickColor.new("Really red") Part.Transparency = 0.75 Part.Anchored = true Part.CanCollide = false Part.TopSurface = "Smooth" Part.BottomSurface = "Smooth" Part.formFactor = "Custom" Part.Size = Vector3.new(0.2, 0.2, (position - script.Parent.CFrame.p).magnitude) Part.CFrame = CFrame.new(position, script.Parent.CFrame.p) * CFrame.new(0, 0, -(position - script.Parent.CFrame.p).magnitude/2) game.Debris:AddItem(Part, 0.5) --Part maker end
end script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
|
| 20 Nov 2012 09:23 PM |
I found a way to fix it
But line 2 needs another part now...Anyone know how to fix it? |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Nov 2012 09:29 PM |
New script crashed because I added a while true do and forgot waits xP
Hang on |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2012 09:30 PM |
Like I said, No output and
function onTouch(part) Lazor = Ray.new(script.Parent.CFrame.p, (workspace.Part.CFrame.p - script.Parent.CFrame.p).unit*300) hit, position = game.Workspace:FindPartOnRay(Lazor, script.Parent) --Raycasting end
--Damage start if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid"):TakeDamage(30) end --Damage end
--Part maker start Part = Instance.new("Part", workspace) Part.Name = "Lazor" Part.BrickColor = BrickColor.new("Really red") Part.Transparency = 0.75 Part.Anchored = true Part.CanCollide = false Part.TopSurface = "Smooth" Part.BottomSurface = "Smooth" Part.formFactor = "Custom" Part.Size = Vector3.new(0.2, 0.2, (position - script.Parent.CFrame.p).magnitude) Part.CFrame = CFrame.new(position, script.Parent.CFrame.p) * CFrame.new(0, 0, -(position - script.Parent.CFrame.p).magnitude/2) game.Debris:AddItem(Part, 0.5) --Part maker end
end script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2012 09:55 PM |
function onTouch(part) Lazor = Ray.new(script.Parent.CFrame.p, (workspace.Part.CFrame.p - script.Parent.CFrame.p).unit*300) hit, position = game.Workspace:FindPartOnRay(Lazor, script.Parent) --Raycasting end
--Damage start if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid"):TakeDamage(30) end --Damage end
--Part maker start Part = Instance.new("Part", Workspace) Part.Name = "Lazor" Part.BrickColor = BrickColor.new("Really red") Part.Transparency = 0.75 Part.Anchored = true Part.CanCollide = false Part.TopSurface = "Smooth" Part.BottomSurface = "Smooth" Part.formFactor = "Custom" Part.Size = Vector3.new(0.2, 0.2, (position - script.Parent.CFrame.p).magnitude) Part.CFrame = CFrame.new(position, script.Parent.CFrame.p) * CFrame.new(0, 0, -(position - script.Parent.CFrame.p).magnitude/2) game.Debris:AddItem(Part, 0.5) --Part maker end
end script.Parent.Touched:connect(onTouch)
Why is it onTouch? |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2012 09:58 PM |
Im trying to make a button to send out the ray
The thing is
workspace.Part.CFrame.p
I dont want it needing another part to have to go to, I want it to just go |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Nov 2012 10:01 PM |
P is a part of CFrame.
The script works fine, I just need it to not need that second part. |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2012 10:04 PM |
function onTouch(part) Lazor = Ray.new(script.Parent.CFrame.p, (workspace.Part.CFrame.p - script.Parent.CFrame.p).unit*300) hit, position = game.Workspace:FindPartOnRay(Lazor, script.Parent) --Raycasting end
--Damage start if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid"):TakeDamage(30) end --Damage end
--Part maker start Part = Instance.new("Part", Workspace) Part.Name = "Lazor" Part.BrickColor = BrickColor.new("Really red") Part.Transparency = 0.75 Part.Anchored = true Part.CanCollide = false Part.TopSurface = "Smooth" Part.BottomSurface = "Smooth" Part.formFactor = "Custom" Part.Size = Vector3.new(0.2, 0.2, (position - script.Parent.CFrame.p).magnitude) Part.CFrame = CFrame.new(position, script.Parent.CFrame.script.Parent) * CFrame.new(0, 0, -(position - script.Parent.CFrame.script.Parent).magnitude/2) game.Debris:AddItem(Part, 0.5) --Part maker end
end script.Parent.Touched:connect(onTouch)
LolIfailded |
|
|
| Report Abuse |
|
|
| |
|
| |
|