generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Health Ray Help Please

Previous Thread :: Next Thread 
egghead is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. egghead
Joined: 09 Jun 2007
Total Posts: 913
18 Apr 2010 11:09 PM
Bump please
Report Abuse
bailinbone15 is not online. bailinbone15
Joined: 11 Dec 2007
Total Posts: 7590
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 is not online. egghead
Joined: 09 Jun 2007
Total Posts: 913
26 Apr 2010 01:06 AM
Bump
Up
My
Post

Please?
Report Abuse
nate890 is not online. 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 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
26 Apr 2010 01:27 AM
Oh, nvm I see it.. IN CAPITALS.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
26 Apr 2010 01:28 AM
Harhar, only 1 Parent, I think.
Report Abuse
XAXA is not online. 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
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
26 Apr 2010 12:32 PM
if ("" ~= "") then


it'll never work ...... there is no way "" can't be equal ""
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image