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: Find The object name

Previous Thread :: Next Thread 
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
28 Nov 2011 09:45 PM
Lets say I have a brick and if something touches it how to i get the name if it and put it in a variable?
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
28 Nov 2011 09:45 PM
local a = ""

brick.Touched:connect(function(hit)
a = hit.Name
end)
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
28 Nov 2011 09:46 PM
script.Parent.Touched:connect(function(part)
print(part.Name)
end)

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
28 Nov 2011 09:46 PM
Do you mean something like this?

game.Workspace.Part.Touched:connect(function(hit)
if hit.Name == ""--Name then
--code
end
end)

Not 100% sure what you want..
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
28 Nov 2011 09:50 PM
Thanks but how do I get the name if the Model not the brick?
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
28 Nov 2011 09:51 PM
Btw i was replying to swimguy
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
28 Nov 2011 09:52 PM
@miz
I wan't to retriev the name if the model.
Report Abuse
DXPower is not online. DXPower
Joined: 21 Oct 2008
Total Posts: 2866
28 Nov 2011 09:52 PM
function touched(hit)
print(hit.Parent.Name)
end

script.Parent.Touched:connect(touched)

-Taste the forum rainbow!-
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
28 Nov 2011 09:52 PM
Wait my first post i was replying to waffle not swim guy.
Sorry
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
28 Nov 2011 09:56 PM
Do you want the full name?

print(model:GetFullName)

Output
game.Workspace.model
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
28 Nov 2011 09:56 PM
@DXPower
Thank you it worked!
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
28 Nov 2011 09:57 PM
@Miz
No I just wanted a player only door.
xD
If you want the full code I can give it to you so you can see what I was trying to do
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
28 Nov 2011 09:58 PM
whatever!!! wasnt sure what u wanted
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