generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Working with Hopperbins... I need help!

Previous Thread :: Next Thread 
jetlogan is not online. 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 is not online. 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
buddy249950 is not online. buddy249950
Joined: 30 Jun 2016
Total Posts: 3536
10 Nov 2012 09:39 PM
Probably mouse target seeing as though it's a hopperbin.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
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 is not online. 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 is not online. 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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image