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
 

Re: Removetools script not working

Previous Thread :: Next Thread 
veryawesomeboy is not online. veryawesomeboy
Joined: 21 May 2013
Total Posts: 479
01 Jan 2017 12:06 PM
I've made a teleport button, but I need it to remove your tools when you click it. However, it pretty much toolbans you from any tools. Here's the code:
function Click()
game.Players.LocalPlayer.Backpack:ClearAllChildren()
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(2, 1, -109) --- change this to wherever you want to be teleported
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16
script.Parent.Parent.Parent.Parent.Character.Humanoid.JumpPower = 50
for index, child in pairs(script.Parent.Parent.Parent.Parent.Character.Humanoid.Parent:GetChildren()) do
if child.ClassName == "Tool" then
child:Destroy()
end
end
end
script.Parent.MouseButton1Down:connect(Click)



Report Abuse
veryawesomeboy is not online. veryawesomeboy
Joined: 21 May 2013
Total Posts: 479
01 Jan 2017 12:19 PM
bump


Report Abuse
X_FREAKY is not online. X_FREAKY
Joined: 02 Jul 2016
Total Posts: 60
01 Jan 2017 12:27 PM
HumanoidRootPart, not torso.


Report Abuse
veryawesomeboy is not online. veryawesomeboy
Joined: 21 May 2013
Total Posts: 479
01 Jan 2017 07:12 PM
No. The teleport works just fine, but the tools removal keep running, instead of running once.


5,872
Report Abuse
eRanged is online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
01 Jan 2017 07:15 PM
Try this?

Humanoid:UnequipTools()
Backpack:ClearAllChildren()


Report Abuse
veryawesomeboy is not online. veryawesomeboy
Joined: 21 May 2013
Total Posts: 479
01 Jan 2017 08:03 PM
Thank you VERY much! It works like a charm!


5,724
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