Xantar123
|
  |
| Joined: 03 Jan 2010 |
| Total Posts: 470 |
|
|
| 11 Feb 2014 02:30 PM |
I can see no problem with this script and yet for some reason it does not work.
function touch(h) if h.name == "left leg" or h.name == "Right leg" then print("RUN FOR YOUR LIFE!") wait(5) h:destroy() end end
script.parent.touched:connect(touch)
Whenever a humanoid leg touches this block I want it to print "RUN FOR YOUR LIFE!" And then the message to go away after 5 seconds....
Which that is not happening AT ALL.
I am new to scripting so I'm not really sure why this is not working.. Help anyone? |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 11 Feb 2014 02:31 PM |
Capitals.
script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 11 Feb 2014 02:32 PM |
| And I don't think you can use or but you can use elseif |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 11 Feb 2014 02:35 PM |
or works fine here. he only forgot Right Leg. and Left Leg. so it wont work anyway.
|
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
| |
|
|
| 11 Feb 2014 02:38 PM |
U can use or.. Also
deb=false--debounce is very important script.Parent.Touched:connect(function(thing) if thing.Name == "Left Leg" and deb == false or thing.Name =="Right Leg" and deb == false then deb=true wait(5) deb = false thing:destroy() end end)
|
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 02:40 PM |
| Oop,add that print"run for ur life!" Bit after deb = true |
|
|
| Report Abuse |
|
|
Link5659
|
  |
| Joined: 04 Jun 2012 |
| Total Posts: 4525 |
|
|
| 11 Feb 2014 02:41 PM |
function.touched(h) if h.name == "left leg" or h.name == "Right leg" then print("RUN FOR YOUR LIFE!") wait(5) h:destroy() end end |
|
|
| Report Abuse |
|
|
Link5659
|
  |
| Joined: 04 Jun 2012 |
| Total Posts: 4525 |
|
|
| 11 Feb 2014 02:41 PM |
| WAIT DON'T USE MINE USE THE GUYS ABOVE MY POSTS |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 11 Feb 2014 02:43 PM |
Link, not close :/
Deb = false
script.Parent.Touched:connect(Hit) if (Hit.Parent.Humanoid) and (Deb == false) then Deb = true print("RUN FOR YOUR LIFE!") wait(5) Hit:Destroy() end end) |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 11 Feb 2014 02:44 PM |
| Nvm link, you were also a bit close. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 11 Feb 2014 02:44 PM |
Nvm link, you were also a bit close.
Now go out and rescue Zelda! D: |
|
|
| Report Abuse |
|
|
Link5659
|
  |
| Joined: 04 Jun 2012 |
| Total Posts: 4525 |
|
|
| 11 Feb 2014 02:45 PM |
@ABOVE ME PLEAES HELP ME BRO I POSTED TO MINE THAT YOU COULDN'T READ.
@Above me please help me bro I posted to mine that you couldn't read. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 09:59 PM |
@vlek,i beat u to it /\_/\ but yeah,like vlek said(his is shorter) |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2014 03:42 AM |
script.Parent.Touched:connect(function(touch) if touch.Name == "Right Leg" or "Left Leg" then print "Better Run Little Boy/Girl" wait(5) touch:remove() end end)
--now the message will only work in studios. If you want an actual message do this:
script.Parent.Touched:connect(function(touch) if touch.Name == "Right Leg" or "Left Leg" then local msg = Instance.new("Message", workspace) msg.Text = "Run for your life!" wait(5) msg:remove() touch:remove() end end) |
|
|
| Report Abuse |
|
|
GOLDC3PO
|
  |
| Joined: 31 May 2011 |
| Total Posts: 509 |
|
|
| 12 Feb 2014 07:29 AM |
function touch(h) if h.name == "Left leg" or h.name == "Right leg" then p= Instant.new("Message",game.Players[h.Parent.Name].Playergui) p.Text = "Run for your lives!" wait(5) p:remove() h:remove() end end
script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
EcIiptic
|
  |
| Joined: 12 Aug 2009 |
| Total Posts: 13737 |
|
|
| 12 Feb 2014 09:13 AM |
Sorry to rain on your parade but...
You can't do Lua at all if you can't use proper capitalization.
It's pretty much 100% required. |
|
|
| Report Abuse |
|
|