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: I need help with this script

Previous Thread :: Next Thread 
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
24 Jul 2013 04:52 PM
while true do
if script.Parent.Position.y < 483 then -- Is Height > 482
script.Parent.Parent.Parent."Right Arm".Reflectance = 1
script.Parent.Parent.Parent."Left Arm".Reflectance = 1
script.Parent.Parent.Parent."Torso".Reflectance = 1
script.Parent.Parent.Parent."Right Leg".Reflectance = 1
script.Parent.Parent.Parent["Left Leg".Reflectance = 1
script.Parent.Parent.Parent.Humanoid.Health = script.Parent.Parent.Parent.Humanoid.Health - 2
wait(10)
end

Basically, this script is designed to make the player's bodyparts reflective when they get to a certain altitude in-game. However, on line 3, it says it is expecting a name near the " or something. Halp pl0x?
Report Abuse
ilikepiehaha is not online. ilikepiehaha
Joined: 02 Aug 2011
Total Posts: 316
24 Jul 2013 04:53 PM
script.Parent.Parent.Parent["Right Arm"].Reflectance = 1

Change that part on every line
Report Abuse
MisterEpicSpaghetti is not online. MisterEpicSpaghetti
Joined: 20 Jul 2013
Total Posts: 123
24 Jul 2013 04:54 PM
do script.Parent.Parent.Parent:findFirstChild("BODY PART NAME").Reflectance = 1
:P
Report Abuse
ilikepiehaha is not online. ilikepiehaha
Joined: 02 Aug 2011
Total Posts: 316
24 Jul 2013 04:54 PM
No no, what I have is right.
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
24 Jul 2013 04:55 PM
Same thing happened, only it now expects the "name" near the "["
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
24 Jul 2013 04:57 PM
Speghetti, now it is trying to tell me I am trying to index a function value.
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
24 Jul 2013 05:03 PM
This is really confusing, I don't know what to do now. :L
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
24 Jul 2013 05:09 PM
bump
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
25 Jul 2013 04:13 AM
halp
Report Abuse
UnknownRichGuy is not online. UnknownRichGuy
Joined: 08 Jul 2013
Total Posts: 202
25 Jul 2013 04:16 AM
What is "script.Parent.Position.y"?

This might work.

while true do
if script.Parent.Position.Y.Offset < 483 then
script.Parent.Parent.Parent["Right Arm"].Reflectance = 1
script.Parent.Parent.Parent["Left Arm"].Reflectance = 1
script.Parent.Parent.Parent["Torso"].Reflectance = 1
script.Parent.Parent.Parent["Right Leg"].Reflectance = 1
script.Parent.Parent.Parent["Left Leg"].Reflectance = 1
script.Parent.Parent.Parent.Humanoid.Health = script.Parent.Parent.Parent.Humanoid.Health - 2
wait(10)
end
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
25 Jul 2013 04:19 AM
That script is attempting to index a field Y which is a nil value, apparently.

This is the script I've got.
while true do
if script.Parent.Position.y < 483 then -- Is Height > 482
script.Parent.Parent.Parent.findFirstChild["Right Arm"].Reflectance = 1
script.Parent.Parent.Parent.findFirstChild["Left Arm"].Reflectance = 1
script.Parent.Parent.Parent.findFirstChild["Torso"].Reflectance = 1
script.Parent.Parent.Parent.findFirstChild["Right Leg"].Reflectance = 1
script.Parent.Parent.Parent.findFirstChild["Left Leg"].Reflectance = 1
script.Parent.Parent.Parent.Humanoid.Health = script.Parent.Parent.Parent.Humanoid.Health - 2
wait(10)
end
end

still doesn't work
Report Abuse
UnknownRichGuy is not online. UnknownRichGuy
Joined: 08 Jul 2013
Total Posts: 202
25 Jul 2013 04:19 AM
Like I asked, what is "script.Parent.Position.y"?
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
25 Jul 2013 04:22 AM
Me trying to get the Y coordinate. Hey, I thought it'd work.
Report Abuse
UnknownRichGuy is not online. UnknownRichGuy
Joined: 08 Jul 2013
Total Posts: 202
25 Jul 2013 04:27 AM
dood what the hell is it getting the coordinates of?

i can see what you are trying to do...
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
25 Jul 2013 04:29 AM
Trying to get the co ordinates of a Handle in a tool.
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
25 Jul 2013 04:32 AM
Take out ".findFirstChild" everywhere.
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
25 Jul 2013 04:33 AM
Well that returns me back to the original code
Report Abuse
UnknownRichGuy is not online. UnknownRichGuy
Joined: 08 Jul 2013
Total Posts: 202
25 Jul 2013 04:34 AM
Try to cap the Y but i mean mine should work, i am new(ish) with this stuff so...

Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
25 Jul 2013 04:34 AM
No, the square brackets were what was missing in the original code.
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
25 Jul 2013 04:35 AM
I've tried it with the brackets, it was still broken
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
25 Jul 2013 04:36 AM
Post the code so I can see your mistake.
Report Abuse
UnknownRichGuy is not online. UnknownRichGuy
Joined: 08 Jul 2013
Total Posts: 202
25 Jul 2013 04:36 AM
:o
Ya, sorry idk anything about dealing with tools.
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
25 Jul 2013 04:37 AM
Okay it works now :o
Report Abuse
ssadak is not online. ssadak
Joined: 07 Mar 2012
Total Posts: 30
25 Jul 2013 04:40 AM
I really need help scripting its hard
Report Abuse
Constructor189 is not online. Constructor189
Joined: 28 Apr 2013
Total Posts: 219
25 Jul 2013 04:40 AM
Hmm. One problem is that the health reduction does not loop.
while true do
if script.Parent.Position.y < 483 then -- Is Height > 482
script.Parent.Parent.Parent["Right Arm"].Reflectance = 1
script.Parent.Parent.Parent["Left Arm"].Reflectance = 1
script.Parent.Parent.Parent["Torso"].Reflectance = 1
script.Parent.Parent.Parent["Right Leg"].Reflectance = 1
script.Parent.Parent.Parent["Left Leg"].Reflectance = 1
script.Parent.Parent.Parent.Humanoid.Health = script.Parent.Parent.Parent.Humanoid.Health - 10
wait(3)
end
end

This is the code, there is no error in the output, but it won't keep looping.
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