|
| 31 Jul 2014 07:04 PM |
Ok so I'm trying to make it so a brick goes through a brick and onTouched the workingbag is destroyed, but for some reason it's not being destroy.
game.Players.PlayerAdded:connect(function(p) a = Instance.new("IntValue",p) a.Name = "leaderstats" b = Instance.new("IntValue",a) b.Name = "Money" b.Value = 50 -- Dealer local deb = true
MoneyGiver = game.Workspace.moneygiver
MoneyGiver.Touched:connect(function(hit) if deb == true then deb = false b.Value = b.Value + 200 if hit.Name == "workingbag" then hit:Destory() -- This isn't working, it doesn't remove it deb = true end end end) end) |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 07:05 PM |
hit:Destory()
Take a good look at that one line. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 31 Jul 2014 07:05 PM |
Any errors?
If not, either deb is false or hit.Name is not workingbag. |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 07:12 PM |
@iAmRoblo
I've been trying to figure this out for some time now, I also set deb to go to true instead now, it's not working still |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 07:14 PM |
| You misspelled :Destroy()... |
|
|
| Report Abuse |
|
|
BlupoV2
|
  |
| Joined: 12 Nov 2012 |
| Total Posts: 543 |
|
| |
|
|
| 31 Jul 2014 07:18 PM |
| No sorry originally I had :Remove() but I changed it to :Destroy() on the forum post, just a typo hehe but it still doesn't work |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 07:20 PM |
Fixed it :D
I took out the if-then statement which originally had to do with hit.Name == "workingbag"
and I just made it so it's hit:Destroy() and it works now, thanks guys! |
|
|
| Report Abuse |
|
|