How can I make a player hold a sword without it being in their inventory like they will automatically spawn holding a sword they can not un equip I have no idea how to do this can someone help me out? Or have an idea?
1 Like
You can use a script to weld the sword to the player’s arm instead of using the tool object.
You can put all scripts for the tool inside starter character scripts and then weld the handle to the player’s right arm using a server script.
The script should look similar to this and inside the handle.
local Players = game:GetService('Players')
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local handle = script.Parent
local rightArm = character:WaitForChild('Right Arm')
local weld = Instance.new('Weld')
weld.Name = 'RightGrip'
weld.Part0 = rightArm
weld.Part1 = handle
weld.Parent = rightArm
(The non-weld way)
You could just disable the Backpack UI, calling SetCoreGuiEnabled
on a LocalScript
inside StarterPlayerScripts
:
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
Then on a server script, you can clone the tool & call Humanoid:EquipTool()
so that the Character has the sword held in his hand, but not visible in its inventory
local Sword = game.ServerStorage:WaitForChild("Sword")
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:WaitForChild("Humanoid")
local Clone = Sword:Clone()
Clone.Parent = workspace
Humanoid:EquipTool(Clone)
end)
end)
3 Likes
See i have a problem How can I offset and orientate the sword to be in his hand and not just in his arm?
1 Like