|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 28 Nov 2011 09:50 PM |
| Thanks but how do I get the name if the Model not the brick? |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2011 09:51 PM |
| Btw i was replying to swimguy |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2011 09:52 PM |
@miz I wan't to retriev the name if the model. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 28 Nov 2011 09:52 PM |
Wait my first post i was replying to waffle not swim guy. Sorry |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 28 Nov 2011 09:56 PM |
@DXPower Thank you it worked! |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 28 Nov 2011 09:58 PM |
| whatever!!! wasnt sure what u wanted |
|
|
| Report Abuse |
|
|