DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 12 Jul 2017 08:16 PM |
the target name is SB and allbuildings is
allbuildings = game.Workspace:WaitForChild(player.Name.."Builds"):GetChildren()
mouse.Move:connect(function() target = mouse.Target local character = player.Character magnitude = (character.Torso.Position - target.Position).magnitude if magnitude < 20 then activezone = true else activezone = false end print ("debug") print (target.Name) print (target.Parent.Parent) if target.Name == "SB" and target.Parent.Parent == allbuildings then print("1") for _,v in pairs(allbuildings) do--makes only target color change print("2") if target == v.SB then print("3") target.SelectionBox.Color = BrickColor.new("Fog") else print("4") v.SelectionBox.Color = BrickColor.new("Storm blue") end end end end)
OUTPUT: debug SB DeGamesBuilds
I have no idea.
|
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 12 Jul 2017 08:17 PM |
issue is it won't print 1 2 3 and 4
|
|
|
| Report Abuse |
|
|
|
| 12 Jul 2017 08:20 PM |
try adding a
print(allbuildings==target.Parent.Parent)
if its false then compare by name |
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 12 Jul 2017 08:25 PM |
You define allbuidings as:
allbuildings = game.Workspace:WaitForChild(player.Name.."Builds"):GetChildren()
Which is a table.
Set it as
allbuildings = game.Workspace:WaitForChild(player.Name.."Builds")
Then iterate through
allbuildings:GetChildren() |
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 12 Jul 2017 08:54 PM |
Ohh that helped alot. Didn't know you could print things like that. Thanks!!!
|
|
|
| Report Abuse |
|
|
|
| 12 Jul 2017 08:57 PM |
| cant tell if you're being sarcastic or not |
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 12 Jul 2017 09:09 PM |
I'm serious. I didn't know you could print target.Parent.Parent == allbuildings and get a boolean.
|
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 12 Jul 2017 09:09 PM |
i also feel stupid for overlooking the :GetChildren() part
|
|
|
| Report Abuse |
|
|