Type Index Pages
- BillboardGui
- CanvasGroup
- Frame
- Hint
- ImageButton
- ImageLabel
- PlayerGui
- ScreenGui
- ScrollingFrame
- StarterGui
- SurfaceGui
- TextBox
- TextButton
- TextLabel
- UIAspectRatioConstraint
- UIGradient
- UIGridLayout
- UIListLayout
- UIPadding
- UIPageLayout
- UIScale
- UISizeConstraint
- UITableLayout
- UITextSizeConstraint
- VideoFrame
- ViewportFrame
- ChangeHistoryService
- CoreGui
- DataModelSession
- DockWidgetPluginGui
- MultipleDocumentInterfaceInstance
- Plugin
- PluginAction
- PluginGui
- PluginGuiService
- PluginManager
- PluginMenu
- PluginMouse
- PluginToolbar
- PluginToolbarButton
- QWidgetPluginGui
- Selection
- StandalonePluginScripts
- StatsItem
- StudioService
- StudioTheme
No results found!
-
Instance
- GameSettings
- DebugSettings
- BodyMover
- WeldConstraint
- HttpRbxApiService
- NotificationService
- Translator
- Lighting
- Beam
- GuiService
- UserInputService
- Studio
- Plugin
- HttpService
- Mouse
- BindableEvent
- RunService
- Pages
- Humanoid
- TestService
- PathfindingService
- Chat
- NetworkPeer
- Feature
- CharacterAppearance
- Constraint
- NetworkReplicator
- JointInstance
- Light
- BasePlayerGui
- AnalyticsService
- NetworkMarker
- BinaryStringValue
- FlyweightService
- Geometry
- LoginService
- InstancePacketCache
- ThirdPartyUserService
- TouchInputService
- RuntimeScriptService
- GuidRegistryService
- PartOperationAsset
- DialogChoice
- PhysicsService
- AdService
- TextService
- MarketplaceService
- TeleportService
- Accoutrement
- GamePassService
- AssetService
- InsertService
- PointsService
- ChangeHistoryService
- ServerScriptService
- JointsService
- LogService
- InputObject
- Toolbar
- LuaSettings
- RenderSettings
- AnimationTrack
- PhysicsSettings
- NetworkSettings
- CFrameValue
- Animation
- Color3Value
- BoolValue
- BrickColorValue
- Vector3Value
- AnimationController
- BindableFunction
- Button
- Trail
- LocalizationTable
- LocalizationService
- DebuggerBreakpoint
- DebuggerWatch
- ScriptDebugger
- Animator
- Attachment
- RemoteFunction
- RemoteEvent
- PluginManager
- Camera
- Stats
- Sky
- StarterPlayer
- Dragger
- TerrainRegion
- Path
- TextFilterResult
- Dialog
- StatsItem
- GoogleAnalyticsConfiguration
- ScriptContext
- ControllerService
- CacheableContentProvider
- ReflectionMetadataClasses
- ReflectionMetadataEnums
- DebuggerManager
- GuiBase
- UIBase
- LuaSourceContainer
- GuiItem
- DataModelMesh
- ServiceProvider
- ReflectionMetadataItem
- PostEffect
- PhysicsPacketCache
- TouchTransmitter
- RobloxReplicatedStorage
- Visit
- LuaWebService
- ScriptService
- FlagStandService
- VirtualUser
- SpawnerService
- TimerService
- CookiesService
- Team
- GroupService
- StarterGear
- Message
- PlayerScripts
- Configuration
- ContentProvider
- CollectionService
- Debris
- ReplicatedFirst
- ServerStorage
- ReplicatedStorage
- Folder
- TweenService
- Players
- ContextActionService
- StarterPlayerScripts
- SoundService
- KeyframeSequenceProvider
- VRService
- PluginGuiService
- Player
- Teams
- Pose
- Keyframe
- KeyframeSequence
- IntConstrainedValue
- DoubleConstrainedValue
- ForceField
- RayValue
- Fire
- Smoke
- Sparkles
- ParticleEmitter
- IntValue
- StringValue
- NumberValue
- Explosion
- ObjectValue
- SoundGroup
- UserGameSettings
- ClickDetector
- Sound
- Selection
- BadgeService
- TaskScheduler
- GlobalDataStore
- DataStoreService
- CustomEvent
- CustomEventReceiver
- VirtualInputManager
- FunctionalTest
- TweenBase
- SoundEffect
- ReflectionMetadataEvents
- ClusterPacketCache
- PVInstance
- FaceInstance
- Controller
- ReflectionMetadataCallbacks
- ReflectionMetadataFunctions
- ReflectionMetadataYieldFunctions
- ReflectionMetadataProperties
- ReflectionMetadata
- AdvancedDragger
- HapticService
- FriendService
- GamepadService
No Result Found !!!
EquipTool
For thread safety, this property is not safe to read in an unsynchronized thread.
This function makes the Humanoid
equip the given Tool
.
The below example would cause a Player
to equip a tool in Workspace
named ‘Tool’.
local Players = game:GetService("Players") local player = Players:FindFirstChildOfClass(“Player”) if player and player.Character then local humanoid = player.Character:FindFirstChildOfClass("Humanoid") if humanoid then local tool = workspace:FindFirstChild("Tool") if tool then humanoid:EquipTool(tool) end end end
When this function is called, the humanoid will automatically unequip any Tool|Tools
that it currently has equipped
Although they will be equipped, Tool|Tools
for which Tool/RequiresHandle
is true will not function if they have no handle, regardless if this function is used to equip them or not
See also
- To unequip tools, use
Humanoid/UnequipTools
Parameters
Name | Type | Default | Description |
---|---|---|---|
|
The |
Returns
Return Type | Summary |
---|---|
No return |
Code Samples
Creating a Colorful Brick Tool
The code below creates a new tool and places into the Players/LocalPlayer|LocalPlayer's
Backpack
. Then, the code equips the tool for the player user Humanoid/EquipTool
.
When the tool is equipped and the player uses it (e.g. pressed their mouse button in-game), the code spawns a new BasePart|part
at the position of the click using the Humanoid/TargetPoint
position. The code also sets several of the part’s properties, such as giving it a random BasePart/BrickColor
.
local player = game.Players.LocalPlayer local character = player.CharacterAdded:wait() local humanoid = character.Humanoid -- Make a new tool and handle and put it in the player's Backpack local function makeTool() -- Create tool local tool = Instance.new("Tool") tool.Parent = player:WaitForChild("Backpack") -- Create tool handle local handle = Instance.new("Part") handle.Name = "Handle" handle.Parent = tool handle.BrickColor = BrickColor.Random() -- Enable and equip tool tool.Enabled = true humanoid:EquipTool(tool) -- Handle tool use tool.Activated:Connect(onActivated) end -- Create a new randomly colored part at *pos* world position local function spawnPart(pos) local part = Instance.new("Part") part.Anchored = true part.Size = Vector3.new(1,1,1) part.Position = pos part.Parent = game.Workspace part.BrickColor = BrickColor.Random() end -- Spawn a new part at TargetPoint when the tool is activated function onActivated() spawnPart(humanoid.TargetPoint) end -- Make a new tool when the LocalScript first runs makeTool()
How this site use cookies
This Platform uses cookies to offer you a better experience, to personalize content, to provide social media features and to analyse the traffic on our site. For further information, including information on how to prevent or manage the use of cookies on this Platform, please refer to our Privacy and Cookie Policy.