|
| 15 Mar 2013 12:53 AM |
function onTouch(hit)
h = hit.Parent:findFirstChild("Humanoid") if hit ~= nil then if h.Name == "Key" then script.Parent:Destroy() h:Destroy() script.Parent.Parent.Door.CanCollide = false wait(5) script.Parent.Parent.Door.CanCollide = true else end end
end script.Parent.Touched:connect(onTouch) No output.. :/ |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 15 Mar 2013 01:10 AM |
local d
function onTouch(hit)
h = hit and hit.Parent and hit.Parent:findFirstChild("Humanoid") if h.Name == "Key" and not d then d = true hit.Parent:Destroy() script.Parent.Parent.Door.CanCollide = false wait(5) script.Parent.Parent.Door.CanCollide = true d = nil end
end script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
| |
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 15 Mar 2013 01:33 AM |
| So you have part, with humanoid named Key? |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2013 01:54 AM |
| i made it a model. go to my profile and look , hard to explain. |
|
|
| Report Abuse |
|
|
einsteinK
|
  |
| Joined: 22 May 2011 |
| Total Posts: 1015 |
|
|
| 15 Mar 2013 02:37 AM |
First:
h=...:findFirstChild("FIRSTNAME")
Later:
if h.Name == "OTHERNAME" then
So you search for something called FIRSTNAME, ok. But after that you check if the name of it is OTHERNAME ... You looked for FIRSTNAME so it's name would be FIRSTNAME -.- |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2013 03:12 AM |
Lol, thanks. Helped alot, I'll be sure to include helpers in a credit gui |
|
|
| Report Abuse |
|
|