|
| 10 Nov 2014 01:36 AM |
this script doesnt work on a server but works fine when i play solo (this script is inside a part) script.Parent.Touched:connect(function(part) local h = part.Parent:FindFirstchild("Humanoid") if h ~= nil then print ("touched") end end)
there are no error messages D:
it just doesnt work. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Nov 2014 01:39 AM |
| do you have output open online |
|
|
| Report Abuse |
|
|
| |
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 10 Nov 2014 05:19 AM |
| Put print functions for every line. when the functions stop that must be where it is. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2014 09:26 AM |
| ive done everything i could.but it still doesnt work... |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Nov 2014 02:22 PM |
| Are using the local output or sever |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2014 08:43 PM |
| it doesn't say anything besides "output" so i don't really know... |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2014 03:54 AM |
| since the studio updated,i have been having this issue. |
|
|
| Report Abuse |
|
|
GOLDC3PO
|
  |
| Joined: 31 May 2011 |
| Total Posts: 509 |
|
|
| 12 Nov 2014 06:19 AM |
script.Parent.Touched:connect(function(part) local h = part.Parent["Humanoid"] if h ~= nil then print ("touched") end end)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Nov 2014 08:17 AM |
script.Parent.Touched:connect(function(part) local h = part.Parent:FindFirstChild("Humanoid") if h ~= nil then print ("touched") end end)
--you didn't capitalize Child, i doubt that would cause an issue, but maybe? |
|
|
| Report Abuse |
|
|
|
| 13 Nov 2014 12:30 AM |
script.Parent.Touched:connect(function(part) local h = part.Parent:FindFirstChild("Humanoid") if h ~= nil then print ("touched") end end)
works fine when i play solo but doesnt work on a server... |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 13 Nov 2014 12:36 AM |
just do
debounce = false script.Parent.Touched:connect(function(part) if part.Parent:FindFirstChild("Humanoid") ~= nil and not debounce then --you could get rid of ~= nil but it's kind of weird that Lua allows that and doesn't make sense for anyone who uses other languages. debounce = true print("touched") debounce = false end end)
Now are you ever looking for your output? Try something instead of printing "touched" and I bet it'll work. I also added a debounce to avoid the function repeating unreasonably (because that's how ROBLOX's Touched event works) |
|
|
| Report Abuse |
|
|
|
| 14 Nov 2014 12:52 AM |
| thanks for trying to help me,but it still doesn't work T_T |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 14 Nov 2014 12:54 AM |
@Op You are either lying or looking at the local output
I just tried the script it does work |
|
|
| Report Abuse |
|
|
|
| 14 Nov 2014 01:49 AM |
i'm not lying,it really doesn't work
how do you know if its a local output btw |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 14 Nov 2014 01:50 AM |
| the roblox default online output by default opens the local output |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 14 Nov 2014 01:56 AM |
| https://www.youtube.com/watch?v=of7wEsq26lw |
|
|
| Report Abuse |
|
|
|
| 14 Nov 2014 02:06 AM |
Whoa,works...thanks for helping me :D
works now :D |
|
|
| Report Abuse |
|
|