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 » Scripters
Home Search
 

Re: Transparency is not a valid member of script... wat

Previous Thread :: Next Thread 
Vritix is not online. Vritix
Joined: 01 Jan 2011
Total Posts: 2790
27 Sep 2015 09:57 PM
What is this script doing... "script.Parent.Parent:GetChildren() leads the script to a model not a script"..

Error :
Transparency is not a valid member of Script
19:55:41.842 - Script 'Workspace.Panel.Close.Touched.Script', Line 8

Script :

local bool = true
local clearance = {
['M01-Card'] = true,
}
function open(touch)
if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
for i,v in pairs(script.Parent.Parent:GetChildren() ) do
v.Transparency = 1
end
for i,v in pairs(script.Parent.Parent.Parent.Open:GetChildren() ) do
v.Transparency = 0
end
script.Parent.Parent.Parent.Close.logo.Decal.Transparency = 1
script.Parent.Parent.Parent.Open.logo.Decal.Transparency = 0
wait(2)
script.Parent.Parent.Parent.Touched.Script.Disabled = false
script.Disabled = true
end
end
script.Parent.Touched:connect(open)



just do it
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
27 Sep 2015 10:04 PM
Read the error, "Script" DOESNOT have any property called Transparency!

morashsPeasant is swagilicious?
Report Abuse
Vritix is not online. Vritix
Joined: 01 Jan 2011
Total Posts: 2790
27 Sep 2015 10:07 PM
I understand that but WHY is it referring to the script when it should be referring to the Children inside "script.Parent.Parent:GetChildren()"



just do it
Report Abuse
Vendicular is not online. Vendicular
Joined: 12 Apr 2013
Total Posts: 218
27 Sep 2015 10:16 PM
just add

if v:IsA("Part") then

Report Abuse
unknownusername97 is not online. unknownusername97
Joined: 20 Jun 2013
Total Posts: 3070
27 Sep 2015 10:21 PM
Script doesn't have a property called Transparency.
Report Abuse
Vritix is not online. Vritix
Joined: 01 Jan 2011
Total Posts: 2790
27 Sep 2015 10:21 PM
I fixed it, but did you not see what I said above...? Why is it referring to the script instead of the Children..



just do it
Report Abuse
unknownusername97 is not online. unknownusername97
Joined: 20 Jun 2013
Total Posts: 3070
27 Sep 2015 10:24 PM
You gotta check if the object you are referring to via the script is a Part or not.
Report Abuse
Vendicular is not online. Vendicular
Joined: 12 Apr 2013
Total Posts: 218
27 Sep 2015 10:26 PM
^

your getchildren couldve also gotten a script if it was in the same model

Report Abuse
Xsitsu is online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
27 Sep 2015 10:26 PM
It's not referring to the script that is currently running that code. It's referring to another script that happens to be a child of whatever you called GetChildren() on.
Report Abuse
unknownusername97 is not online. unknownusername97
Joined: 20 Jun 2013
Total Posts: 3070
27 Sep 2015 10:27 PM
Again, YOU HAVE GOT TO CHECK IF THE OBJECT IS A SCRIPT OR NOT!
Report Abuse
Blues714 is not online. Blues714
Joined: 23 Dec 2008
Total Posts: 6507
27 Sep 2015 10:49 PM
reason being is that you were calling pairs without specifying what you are requesting.

v could be any child. (and the script got another script as a child)

that's why you need to specify it by "if v:IsA("Part") then"
Report Abuse
cpmoderator12345 is not online. cpmoderator12345
Joined: 26 Jan 2013
Total Posts: 15651
28 Sep 2015 12:29 AM
this is stupid
the current child was a script
idiot
Report Abuse
tapuzi is not online. tapuzi
Joined: 05 Jul 2014
Total Posts: 162
28 Sep 2015 05:56 AM
When you use ......Parent.Parent.Parent in your script its easy to get lost/miscount etc.
sometimes a simple print command can help you debug.

eg print("Thingy: ".. v.Name) --

or in your script:-

for i,v in pairs(script.Parent.Parent:GetChildren() ) do
print("Thingy: ".. v.Name) -- most things have a name i think
v.Transparency = 1
end
Where's my chips?

-- a common mistake is to have too many/few .Parents in your statements
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
28 Sep 2015 06:37 AM
"this is stupid
the current child was a script
idiot"

You are an intolerant and misunderstanding hypocrite. It is perfectly normal to not know or understand something. I mean, even you didn't understand how common this is, so you have that problem yourself.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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