generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Destroy() isn't working? Please help ^_^

Previous Thread :: Next Thread 
ToldFables is not online. ToldFables
Joined: 04 May 2013
Total Posts: 588
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
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
31 Jul 2014 07:05 PM
hit:Destory()

Take a good look at that one line.
Report Abuse
swmaniac is not online. 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
ToldFables is not online. ToldFables
Joined: 04 May 2013
Total Posts: 588
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
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
31 Jul 2014 07:14 PM
You misspelled :Destroy()...
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
31 Jul 2014 07:16 PM
Dat syntax tho
Report Abuse
ToldFables is not online. ToldFables
Joined: 04 May 2013
Total Posts: 588
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
ToldFables is not online. ToldFables
Joined: 04 May 2013
Total Posts: 588
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image