|
| 13 Mar 2012 04:37 PM |
Why does this not work?
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local a = game.Lighting.Zombie1:Clone() a.Parent = game.Workspace a:MakeJoints() wait(300) end end)
I can't figure out why... |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 04:40 PM |
| Insert service not local!! |
|
|
| Report Abuse |
|
|
| |
|
stroudie
|
  |
| Joined: 28 Nov 2008 |
| Total Posts: 2556 |
|
| |
|
stroudie
|
  |
| Joined: 28 Nov 2008 |
| Total Posts: 2556 |
|
|
| 13 Mar 2012 05:09 PM |
| And what's actually not working? |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 05:13 PM |
| Its not sumoning the zombie |
|
|
| Report Abuse |
|
|
stroudie
|
  |
| Joined: 28 Nov 2008 |
| Total Posts: 2556 |
|
|
| 13 Mar 2012 05:17 PM |
| Hmm... I tested it in studio with a simple model from Lighting. Worked fine. Is the script inside a part? Are you sure the model isn't in a bad position where it falls off the map? |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 05:19 PM |
| Dude i know what im doing when i tested it the zombie just diden't spawn when i placed it on the map and hit the button., |
|
|
| Report Abuse |
|
|
stroudie
|
  |
| Joined: 28 Nov 2008 |
| Total Posts: 2556 |
|
|
| 13 Mar 2012 05:25 PM |
| Ok, have you got the explorer window open? If not, open if via view > Explorer. Then click the plus by the workspace and tell me what you see when you run the script. |
|
|
| Report Abuse |
|
|
stroudie
|
  |
| Joined: 28 Nov 2008 |
| Total Posts: 2556 |
|
|
| 13 Mar 2012 05:25 PM |
| *it (My typing is going downhill in acurracy today) |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 05:35 PM |
| Dude.. im not a baby i know how to use roblox studio im learning how to script. it works now, but the zombies spawn too fast and the Wait part does nothing... |
|
|
| Report Abuse |
|
|
stroudie
|
  |
| Joined: 28 Nov 2008 |
| Total Posts: 2556 |
|
|
| 13 Mar 2012 05:42 PM |
| Alright, sorry for doubting you. I usually judge peoples knowledge on grammar >_>. Anyway... post the script that you've got now (That works) and i'll fix that. |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 05:47 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local a = game.Lighting.Zombie1:Clone() a.Parent = game.Workspace a:MakeJoints() wait(300) end end)
|
|
|
| Report Abuse |
|
|
stroudie
|
  |
| Joined: 28 Nov 2008 |
| Total Posts: 2556 |
|
|
| 13 Mar 2012 05:49 PM |
Try this:
Toggle = false
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and Toggle == false then Toggle = true local a = game.Lighting.Zombie1:Clone() a.Parent = game.Workspace a:MakeJoints() wait(300) Toggle = false end end)
|
|
|
| Report Abuse |
|
|
| |
|
stroudie
|
  |
| Joined: 28 Nov 2008 |
| Total Posts: 2556 |
|
|
| 13 Mar 2012 05:58 PM |
| That will make it only work if the toggle value is false. The toggle value is kept true until the wait has finished, therefore it acts as a debounce and stops the script activating WHENEVER you touch the brick. |
|
|
| Report Abuse |
|
|
| |
|