jetlogan
|
  |
| Joined: 05 May 2010 |
| Total Posts: 1423 |
|
|
| 10 Nov 2012 09:23 PM |
I am trying to make a script that if you hit a block it will say its name. Here is my script:
local hop = script.Parent
function Selected() print("Selected") end hop.Selected:connect(Selected)
function FindName() print(Hit.name) end
Thanks |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 10 Nov 2012 09:31 PM |
| I have a question, if the mouse targets the block, or the player hits the block? |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 09:39 PM |
| Probably mouse target seeing as though it's a hopperbin. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 09:39 PM |
for i , v in pairs ( character:GetChildren ( ) ) do v.Touched:connect ( function ( object ) print ( object.Name ) end ) end
deathCast(); |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 10 Nov 2012 10:36 PM |
| You can use a Touched function and use a billboard gui... |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 10 Nov 2012 10:37 PM |
| Oh nevermind thought he meant to add the name above the brick.. |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 10 Nov 2012 10:38 PM |
bin.Selected:connect(function(mouse) mouse.Button1Down:connect(function() if mouse.Target then print(mouse.Target.Name) end end) end) |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 10:41 PM |
local hop = script.Parent function FindName(Hit) print(Hit.Name) end function Selected() print("Selected") for i, v in pairs(hop.Parent:GetChildren()) do if v:IsA("Part") then v.Touched:connect(function(Block) FindName(Block) end) end end end hop.Selected:connect(Selected)
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|