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 |
|
|
|
| 27 Sep 2015 10:04 PM |
Read the error, "Script" DOESNOT have any property called Transparency!
morashsPeasant is swagilicious? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 27 Sep 2015 10:16 PM |
just add
if v:IsA("Part") then
|
|
|
| Report Abuse |
|
|
|
| 27 Sep 2015 10:21 PM |
| Script doesn't have a property called Transparency. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 27 Sep 2015 10:26 PM |
^
your getchildren couldve also gotten a script if it was in the same model
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 27 Sep 2015 10:27 PM |
| Again, YOU HAVE GOT TO CHECK IF THE OBJECT IS A SCRIPT OR NOT! |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 28 Sep 2015 12:29 AM |
this is stupid the current child was a script idiot
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|