|
| 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 |
|
|
| |
|
X_FREAKY
|
  |
| Joined: 02 Jul 2016 |
| Total Posts: 60 |
|
|
| 01 Jan 2017 12:27 PM |
HumanoidRootPart, not torso.
|
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 01 Jan 2017 07:15 PM |
Try this?
Humanoid:UnequipTools() Backpack:ClearAllChildren()
|
|
|
| Report Abuse |
|
|
|
| 01 Jan 2017 08:03 PM |
Thank you VERY much! It works like a charm!
5,724 |
|
|
| Report Abuse |
|
|