ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
|
| 29 Dec 2014 02:29 PM |
script.Parent.Touched:connect(function(hit) print(hit) local e = Instance.new("Explosion", workspace) e.Position = script.Parent.Position end)
coroutine.wrap(function() for i = 1,100 do wait() p.CFrame = p.CFrame * CFrame.new(4,0,0) end p:remove() end)()
Why wont it fire? When it hits a part nothing gets printed |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 29 Dec 2014 02:33 PM |
| Is it a local script? cus it shouldnt be |
|
|
| Report Abuse |
|
|
frommage
|
  |
| Joined: 22 Apr 2014 |
| Total Posts: 100 |
|
|
| 29 Dec 2014 02:52 PM |
| Workspace should be capitalized |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 29 Dec 2014 02:54 PM |
| workspace doesnt have to be capitalized if ur using it as a var |
|
|
| Report Abuse |
|
|
frommage
|
  |
| Joined: 22 Apr 2014 |
| Total Posts: 100 |
|
|
| 29 Dec 2014 02:54 PM |
| he didn't define it as a variable tho |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 29 Dec 2014 02:55 PM |
nope go into command line and type Instance.new('Part', workspace) trust me itll spawn |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 29 Dec 2014 02:57 PM |
| He meant that workspace and Workspace are both global variables that reference to game.Workspace |
|
|
| Report Abuse |
|
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
|
| 29 Dec 2014 05:58 PM |
| Nope, it's in a normal script |
|
|
| Report Abuse |
|
|
|
| 29 Dec 2014 05:59 PM |
Workspace by its own is deprecated now.
If you're not going to use 'game.Workspace' then the proper use is 'workspace' |
|
|
| Report Abuse |
|
|
| |
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
|
| 29 Dec 2014 06:04 PM |
| It with the script.Parent.Touched part |
|
|
| Report Abuse |
|
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
| |
|
golfercab
|
  |
| Joined: 26 Sep 2011 |
| Total Posts: 714 |
|
|
| 29 Dec 2014 08:38 PM |
I think the print variable, ironically, is holding it up. Should be print(hit.Name), hit itself is an object, cant turn an object into a string unless you refer to its properties
also, check the output box, what does it say? |
|
|
| Report Abuse |
|
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
|
| 29 Dec 2014 08:41 PM |
| No, because I've tried it before and it worked and the explosion still doesn't happen. There are no errors in output either |
|
|
| Report Abuse |
|
|
golfercab
|
  |
| Joined: 26 Sep 2011 |
| Total Posts: 714 |
|
|
| 29 Dec 2014 08:59 PM |
| atleast change it to print(hit.Name) and check the output please |
|
|
| Report Abuse |
|
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
|
| 30 Dec 2014 12:24 PM |
| Ive changed it to print("Hi"), but it still wont print. |
|
|
| Report Abuse |
|
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
| |
|
golfercab
|
  |
| Joined: 26 Sep 2011 |
| Total Posts: 714 |
|
|
| 30 Dec 2014 05:14 PM |
| oh, weird, only thing i could think of that may be preventing it from firing is if there is a wait(some number) that is higher up in the script than the function that hasn't finished running holding up the script, or there is a WaitForChild(some child's name that doesnt even exist) doing the same thing |
|
|
| Report Abuse |
|
|
golfercab
|
  |
| Joined: 26 Sep 2011 |
| Total Posts: 714 |
|
|
| 30 Dec 2014 05:15 PM |
| or script.Parent is something that is not being touched |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2014 05:25 PM |
Made it work, your welcome.
p = script.Parent
script.Parent.Touched:connect(function(hit) local e = Instance.new("Explosion", workspace) e.Position = script.Parent.Position end)
coroutine.wrap(function() for i = 1,100 do wait() p.CFrame = p.CFrame * CFrame.new(4,0,0) end p:remove() end) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 30 Dec 2014 05:27 PM |
Ryan, you changed nothing but just created a reference. It doesn't matter the coroutine part was broken (even though you made it not even called at all). The important part that is not working is the Touched listener. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2014 05:27 PM |
| The explosion bit works though.. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 30 Dec 2014 05:30 PM |
| Exactly, the OP's script also worked for me. It's him doing something wrong. |
|
|
| Report Abuse |
|
|