Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How is it possible to force equip something?

Asked by 7 years ago

Hey there, sorry to bother, but I'm looking for a way to force equip something in the player's backpack, I want to have a flashlight in the player's hand but I want them to not be able to de-equip it. Is there a way to do that?

0
Try welding the flashlight to their hand and not make it a tool. CaptainAlien132 225 — 7y
0
@CaptainAlien132 The flashlight has it's own scripts, for hand movement and stuff. aoaoaoaoa00 4 — 7y
0
If it HAS to be a tool, you can use :EquipTool() on the humanoid with a loop. The player can still kinda unequip it but only for a very short moment depending on the loop. User#20279 0 — 7y
0
I second that. Just modify the scripts to work with it. Meltdown81 309 — 7y

3 answers

Log in to vote
0
Answered by
hellmatic 1523 Moderation Voter
7 years ago

Make sure your tool is in StarterPack.

Disable the Backpack from StarterGui

1game.StarterGui:SetCoreGuiEnabled("Backpack", false)

When the player joins the game, take the tool from their backpack, and move it in the player's character

1game.Players.PlayerAdded:connect(function(player)
2    player.CharacterAdded:connect(function(character)
3        player.Backpack:WaitForChild('TOOLNAME').Parent = character
4    end)
5end)
Ad
Log in to vote
1
Answered by 7 years ago

Use Equip Tool

0
Definitely the answer I am looking for aoaoaoaoa00 4 — 7y
Log in to vote
0
Answered by 5 years ago
01wait(0.001)
02EnableBackpackGui = false  --Change it to true if you want to keep backpack icon
03Weapon = script.Parent.Name --Place it in a tool
04local player = game:GetService("Players").LocalPlayer --Use a local script
05local mouse = player:GetMouse(); --Get mosue
06local char = player.Character --Character
07local tool = player.Backpack:FindFirstChild(""..Weapon.."") --Find tool
08db=1
09while wait() do
10if char then
11game.StarterGui:SetCoreGuiEnabled(2,EnableBackpackGui) --Check if Icon is enabled.
12for i,v in ipairs(char:GetChildren()) do
13if v.className ~= ""..Weapon.."" then
14wait()
15if db == 1 then
View all 25 lines...

Answer this question