CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 04:24 PM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character)
holder = Instance.new("ScreenGui") holder.Name = "Holder" holder.Parent = player.PlayerGui
wait()
holder.DescendantAdded:connect(function(descendant) workspace.Part.Name = descendant.Name end)
wait()
new_gui = Instance.new("Frame") new_gui.Name = "New_GUI" new_gui.Parent = holder
end) end)
This did nothing. I then changed .DescendantAdded to .ChildAdded and it changed 'workspace.Part's name. Can someone explain to me WHY?? |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2011 04:30 PM |
| Can you tell me what it's supposed to do? Then I can take a look at it and see what's wrong. |
|
|
| Report Abuse |
|
|
ns001111
|
  |
| Joined: 15 Jan 2011 |
| Total Posts: 2849 |
|
|
| 04 Aug 2011 04:32 PM |
@mikey
If you could ACTUALLY fix it, you wouldn't have to ask what it does. ._. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2011 04:33 PM |
Point made.
~COD~ ==Scripting Helpers Scripter Class-1== |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2011 04:35 PM |
| I'm not a master scripter ok? I can't tell what a script does by simply looking at it. I'll take another look to see if I can figure out what it's supposed to do. |
|
|
| Report Abuse |
|
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 04:54 PM |
Its a pretty simple script, that really isn't supposed to DO anything. I just made it to test .DescendantAdded.
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character)
-- Checks to see when a player is added, and then when a character is added to that player
holder = Instance.new("ScreenGui") holder.Name = "Holder" holder.Parent = player.PlayerGui
-- Creates a 'ScreenGui' named 'Holder', and puts it into the player's 'Playergui'
wait()
-- I hope I don't have to explain what this does
holder.DescendantAdded:connect(function(descendant) workspace.Part.Name = descendant.Name end)
-- This checks to see whenever a descendant is added to the 'Holder'. If a descendant is added, then it changes the name of a part in workspace named 'Part' to the descendant's name. This is the part that is not working, event though it works with '.ChildAdded'
wait()
-- Once again, self-explanitory
new_gui = Instance.new("Frame") new_gui.Name = "New_GUI" new_gui.Parent = holder
-- This creates a 'Frame', named 'New_GUI', and puts it in 'Holder' This should trigger the '.DescendantAdded' and change the name of the part in workspace to 'New_GUI', but it is not doing that
end) end)
-- Ends the functions |
|
|
| Report Abuse |
|
|
| |
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 05:31 PM |
| Wow, I thought going through step by step through EVERY part of my script was good enough. As I stated, it 'ends the function'. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2011 05:31 PM |
| whats with the )? i usualy see just end |
|
|
| Report Abuse |
|
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 05:33 PM |
| No offence, but you probably are not going to be able to help me. The ')' after the ends are closing the '('s at the begging events. |
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
|
| 04 Aug 2011 06:02 PM |
You should add 3 ends. There is 3 functions |
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
| |
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 07:36 PM |
| I swear people don't even read my questions anymore. |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 04 Aug 2011 07:48 PM |
"If you could ACTUALLY fix it, you wouldn't have to ask what it does. ._."
He isn't going to take the time to read threw this with no idea what it's supposed to do. And I'm asking the exact same question right now. |
|
|
| Report Abuse |
|
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 07:52 PM |
| First off, this is an INCREDIBLY simple script, and I stated at the bottom of my FIRST post what it didn't do and what it did do... THEN I posted a COMPREHENSIVE TUTORIAL to my post, and people STILL don't understand it!! |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 04 Aug 2011 07:54 PM |
Also you have
holder.DescendantAdded:connect(function(descendant) workspace.Part.Name = descendant.Name end)
and once you change it once, it won't be there again? |
|
|
| Report Abuse |
|
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 07:55 PM |
| Ok, the whole point of this script is to test whether or not the name will be changed even once. So far .DescendantAdded does nothing. It doesn't change the name at all. |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 04 Aug 2011 07:56 PM |
| Sorry, but I can tell you that ChildAdded will check directly in workspace whereas DescendantAdded checks anything that's a child of a child of workspace and the children of those recursively. It should check like ChildAdded as well though? |
|
|
| Report Abuse |
|
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 08:00 PM |
| It should, but it doesn't. |
|
|
| Report Abuse |
|
|
sm3xykid
|
  |
| Joined: 29 Jul 2011 |
| Total Posts: 22 |
|
|
| 04 Aug 2011 08:02 PM |
@card my main is a top 100 forumer....(not crusher4003 my other one) but anyways do not use it a common malfunction to (function(player) is it kicks that player be careful of that also i dont believe (function(player) is in the directory |
|
|
| Report Abuse |
|
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 08:05 PM |
I'm sorry, I don't really understand what you said. Just because you are in the top 100 in forum posts doesn't really mean you know how to help me, or in all honesty what you even just said...
A common malfunction to '(function(player)'; you realize that I am simply creating a variable, which is the player that was added right? Please read through the whole post. |
|
|
| Report Abuse |
|
|
sm3xykid
|
  |
| Joined: 29 Jul 2011 |
| Total Posts: 22 |
|
|
| 04 Aug 2011 08:10 PM |
@Card you weren't trying to make a table??!! my bad i thought u wanted a table
|
|
|
| Report Abuse |
|
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 09:46 PM |
Breakthrough time... I actually discovered this a while ago, but never really though anything about it I guess... Here are the results of my testing:
.ChildAdded used on a 'Part' > Reacts
.DescendantAdded used on a 'Part' > Reacts
.ChildAdded used on a 'ScreenGui' > Reacts
.DescendantAdded used on a 'ScreenGui' > Doesn't react
I checked the object browser, and .DescendantAdded most certainly is part of a 'ScreenGui'... WHY ROBLOX, WHY do you do this to me? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 04 Aug 2011 10:05 PM |
| Does it get stuff inside the children? |
|
|
| Report Abuse |
|
|
CardCaddy
|
  |
| Joined: 02 Jan 2010 |
| Total Posts: 1025 |
|
|
| 04 Aug 2011 11:18 PM |
| How could it? It doesn't react to a descendant being added. |
|
|
| Report Abuse |
|
|