of     1   

kaloyanthegreater
#185908560Wednesday, March 23, 2016 7:39 PM GMT

Toolname = "BaseballBat" function boop(Player) if not Player.Backpack:FindFirstChild(Toolname) then local Tool = game.Lighting[Toolname]:clone() Tool.Parent = Player.Backpack end end script.Parent.ClickDetector.MouseClick:connect(boop) How to make the brick dissapear after you take the tool?
Madified
#185908654Wednesday, March 23, 2016 7:41 PM GMT

function boop(Player) if not Player.Backpack:FindFirstChild(Toolname) then local Tool = game.Lighting[Toolname]:clone() Tool.Parent = Player.Backpack script.Parent:remove() end end script.Parent.ClickDetector.MouseClick:connect(boop)
KnownEntity
#185908680Wednesday, March 23, 2016 7:41 PM GMT

Im assuming the brick is where the script is placed? Toolname = "BaseballBat" function boop(Player) if not Player.Backpack:FindFirstChild(Toolname) then local Tool = game.Lighting[Toolname]:clone() Tool.Parent = Player.Backpack end script.Parent:Destroy() -- This will delete the brick end script.Parent.ClickDetector.MouseClick:connect(boop)
KnownEntity
#185908890Wednesday, March 23, 2016 7:45 PM GMT

Use :Destroy and NOT :Remove! :Remove is deprecated.
Madified
#185908969Wednesday, March 23, 2016 7:46 PM GMT

Why is :remove deprecated? It works just fine and I believe they function the same
KnownEntity
#185909340Wednesday, March 23, 2016 7:53 PM GMT

Sorry Madified, I wasn't trying to be rude. That was my bad. On the roblox API page for ":Remove" there is a note at the top of the page that reads, "This member exists for compatibility and should not be used in new scripts." Later on it then explains "This item is deprecated in favor of Destroy and ClearAllChildren." They do function the same way and I'm not %100 percent sure why its deprecated although I think it has something to do with how studio handles deletion.
kaloyanthegreater
#185910183Wednesday, March 23, 2016 8:09 PM GMT

Dep's script worked for me.

    of     1