ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 20 Jul 2011 06:30 PM |
I have a brick I want to weld to another brick. It worked the first time, but now it won't. Here's the script:
enabled = true function Touch(part) print("touched!") if not enabled then return end enabled = false print(enabled) w = Instance.new("Weld") w.Parent = game.Workspace print("Parent") w.Part0 = script.Parent w.Part1 = part print("Worked!") end script.Parent.Touched:connect(Touch)
It doesn't print anything. |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
|
| 20 Jul 2011 06:44 PM |
here
enabled = true function Touch(part) print("touched!") if enabled == true then enabled = false print("enabled") w = Instance.new("Weld") w.Parent = game.Workspace print("Parent") w.Part0 = script.Parent w.Part1 = part print("Worked!") end end script.Parent.Touched:connect(Touch) |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 20 Jul 2011 06:47 PM |
| No, my way of making debounce came straight from da wiki. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2011 06:49 PM |
| Not that it really matters, but fix your print, there aren't any quotations. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2011 06:50 PM |
| It should be print("enabled") |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 20 Jul 2011 06:50 PM |
| the print(enabled) is supposed to return false in the output. |
|
|
| Report Abuse |
|
|
| |
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
|
| 20 Jul 2011 06:57 PM |
| ...in yours it returns the script before it prints it >.> if you want it to pring false, you have to put it before it returns |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 20 Jul 2011 06:59 PM |
| Erm... How much do you script? It only returns end if it's false... |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2011 07:02 PM |
| oops lol, im getting confused, im working on 3 scripts at once... |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2011 07:10 PM |
FIXED use my script, and remove the quotation marks from enabled :P and u need to put a wait(blahblah) enabled = true in there too
|
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 20 Jul 2011 07:25 PM |
| It's being dropped from a hight. Would that caused Touched not to fire? Cause that didn't work!!!!1!! D: |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2011 07:34 PM |
| well if your in edit mode, no. connect lines dont work in edit mode |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
hyper900
|
  |
| Joined: 14 May 2009 |
| Total Posts: 873 |
|
|
| 20 Jul 2011 07:49 PM |
A weld's Part0 has to be it's parent I thought :S
I never knew you could weld workspace..... |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2011 07:50 PM |
| he didnt weld workspace... the script is in a brick |
|
|
| Report Abuse |
|
|