c.Lanes.LeftLane.ChildAdded:connect(function(R) l=n.Name s=Notes.Name R.Name=tostring((l)..(s)) print(R) Lane.Value=R:GetFullName() end)
Variables
c=script.Parent.Game.Board -- GUI Object n=(c.Note) -- NumberValue bool Notes=c.Notes --NumberValue bool Lane=c.Lane -- Gui Frame
I don't know why but for some reason the event doesn't fire when a child is added to
c.Lanes.LeftLane I get 0 errors when testing the scripting in Solo Mode.
I think that you're meaning .Value
, rather than .Name
on lines 2 and 3
Tell me if i'm wrong.
c = script.Parent.Game.Board n = (c.Note) Notes = c.Notes Lane = c.Lane c.Lanes.LeftLane.ChildAdded:connect(function(R) l = n.Value s = Notes.Value R.Name=tostring((l)..(s)) print(R) Lane.Value = R:GetFullName() end)
It doesn't work because you tell it to print R, and not R's name. Here's the fixed script:
c.Lanes.LeftLane.ChildAdded:connect(function(R) l=n.Name s=Notes.Name R.Name=tostring((l)..(s)) print(R.Name) --If it's just "R", then it tries to print userdata, and not a string (R's name) Lane.Value=R:GetFullName() end)