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 » Scripters
Home Search
 

Doesnt delete the tool

Previous Thread :: Next Thread 
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
06 Aug 2015 01:16 PM
Block = script.Parent

Block.Touched:connect(function(Touched)
local Character = Touched:FindFirstChild("Character")
print ("Character Found")
if Character then
local Player = Character
local Tool = Character:FindFirstChild("Tool")
if Tool then
Tool:remove()
end
end
end)

It prints "Character Found", but doesnt deletes the tool.

No output


bump
Report Abuse
Darkenus is not online. Darkenus
Joined: 17 Jul 2014
Total Posts: 1997
06 Aug 2015 01:21 PM
block = script.Parent

block.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local tool = player.Backpack:FindFirstChild("Tool")
if tool then
tool:Destroy()
end
end
end)

On mobile, so can't indent so much. :/
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
06 Aug 2015 01:21 PM
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent:FindFirstChild("Tool") then
hit.Parent.Tool:Destroy()
end
end
end)
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
06 Aug 2015 01:22 PM
Thanks


bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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