egghead
|
  |
| Joined: 09 Jun 2007 |
| Total Posts: 913 |
|
|
| 18 Apr 2010 10:12 PM |
Hello, I am currently working on a neat beam that heals whoever it touches. This is just a snippet of code (It won't work on its own) and I need someone to tell me what's wrong. Everythign works except the healing section.
if (key == "C") then if (Debounce == false) then if (Lazer == false) then Debounce = true Lazer = true DisableLimb(NormalHand) SetAngle(NormalHand, 0.785) smokeBrick = Instance.new("Part") smokeBrick.CanCollide = false smokeBrick.Anchored = true smokeBrick.Transparency = 1 smokeBrick.Locked = true smokeBrick.archivable = false smokeBrick.TopSurface = 0 smokeBrick.BottomSurface = 0 smoke = Instance.new("Sparkles") while true do if (Lazer == false) then break end local Pos = mouse.Hit.p smokeBrick.Parent = Person.Character smokeBrick.CFrame = CFrame.new(Pos) if (mouse.Target) and (mouse.Target ~= nil) then smoke.Parent = smokeBrick end local L = Instance.new("Part") L.Parent = Person.Character L.Name = "Heal Laser" L.BrickColor = BrickColor.new("Bright green") L.formFactor = 0 L.Size = Vector3.new(1, 1, 1) L.Locked = true L.Anchored = true L.CanCollide = false L.Transparency = 0.1 L.Reflectance = 0.5 local Place0 = Person.Character.Suit.Watch2.CFrame * CFrame.new(0, -0.1, 0) local Mesh = Instance.new("CylinderMesh") Mesh.Parent = L Mesh.Scale = Vector3.new(0.1, (Place0.p - Pos).magnitude, 0.1) L.CFrame = CFrame.new((Place0.p + Pos)/2, Place0.p) * CFrame.fromEulerAnglesXYZ(math.pi/2, 0, 0) if (mouse.Target ~= nil) then if (mouse.Target.Parent.Name:lower() == "") or ("" == "") then if ("" ~= "") then if (mouse.Target.Parent.Humanoid ~= nil) then mouse.Target.Parent.Parent.Humanoid.Health = mouse.Target.Parent.Parent.Humanoid.Health+100 ---HERE IS THE PROBLEM else mouse.Target.Humanoid:remove() --- I COULDN'T THINK OF WHAT TO PUT HERE end end end end wait() L:Remove() end Debounce = false smokeBrick.Parent = nil EnableLimb(NormalHand) end end end |
|
|
| Report Abuse |
|
|
Fireant14
|
  |
| Joined: 05 Apr 2009 |
| Total Posts: 577 |
|
|
| 18 Apr 2010 10:14 PM |
| Did you check the "output" bar. That tells you what went wrong, where. |
|
|
| Report Abuse |
|
|
egghead
|
  |
| Joined: 09 Jun 2007 |
| Total Posts: 913 |
|
|
| 18 Apr 2010 10:17 PM |
| The unfortunate thing is that I'm actually building off of someone else's base code. I run this with person299's c/ script run prompt. I have no output. |
|
|
| Report Abuse |
|
|
egghead
|
  |
| Joined: 09 Jun 2007 |
| Total Posts: 913 |
|
|
| 18 Apr 2010 10:18 PM |
| What I'm saying is that it has to be done in online mode. The whole script itself contains instructions for building multiple attachments on to the body. |
|
|
| Report Abuse |
|
|
Fireant14
|
  |
| Joined: 05 Apr 2009 |
| Total Posts: 577 |
|
|
| 18 Apr 2010 10:21 PM |
| Oh, can't help you there; i'm only learning but that doesn't mean I don't know some things. |
|
|
| Report Abuse |
|
|
egghead
|
  |
| Joined: 09 Jun 2007 |
| Total Posts: 913 |
|
| |
|
|
| 18 Apr 2010 11:22 PM |
Start a local server and add players to get output.
Tools>Test>Start Server
A new studio window should open. From that new window, do:
Tools>Test>Add Player
You should spawn as a default character.
From there you can get output. |
|
|
| Report Abuse |
|
|
egghead
|
  |
| Joined: 09 Jun 2007 |
| Total Posts: 913 |
|
| |
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Apr 2010 01:23 AM |
| Post the healing part of the script, please. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Apr 2010 01:27 AM |
| Oh, nvm I see it.. IN CAPITALS. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 26 Apr 2010 01:28 AM |
| Harhar, only 1 Parent, I think. |
|
|
| Report Abuse |
|
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
|
| 26 Apr 2010 04:00 AM |
You COULD just make a gun and change its damage to negative (eg damage = 10 to damage = -10 |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2010 12:32 PM |
if ("" ~= "") then
it'll never work ...... there is no way "" can't be equal "" |
|
|
| Report Abuse |
|
|