Unalaq
|
  |
| Joined: 30 Jun 2013 |
| Total Posts: 196 |
|
|
| 10 May 2014 04:46 PM |
function onTouched(hit) script.Parent.Ghost:play() end script.Parent.Touched:connect(onTouched)
Need a delete script after this for jumpscare, would be awesome if someone could help. |
|
|
| Report Abuse |
|
|
| |
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 10 May 2014 04:51 PM |
Like this? local time = "ANumb3rV4lue." script.Parent.Touched:connect(function(touch) if touch.Parent:FindFirstChild("Humanoid") then Ghost:Play() wait(tonumber(time)) --Just to be safe. It'll convert everything to a number first, so if there's a string in the time value it'll get the digits in it. script.Parent:Destroy() else return end end)
--Shira Wolven |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 May 2014 04:53 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then script.Parent.Ghost:Play() repeat wait() until script.Parent.Ghost.IsPlaying == false Ghost:Destroy() end end) |
|
|
| Report Abuse |
|
|
Unalaq
|
  |
| Joined: 30 Jun 2013 |
| Total Posts: 196 |
|
|
| 10 May 2014 04:57 PM |
| Just what I needed thanks guys! |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 10 May 2014 04:58 PM |
| Goulstem, last time I relied on isplaying, it was VERY buggy. It doesn't turn off until you Stop() or Pause() the sound. |
|
|
| Report Abuse |
|
|