I want to implement the ability to switch tools whilst keeping the unable to unequip tool function, alongside making it so you equip the 1st tool in your backpack as soon as you join.
Can someone help with adding that? None of my methods worked & caused studio crashes, so here’s an older version of my script that doesn’t have my own attempts at doing that in it.
wait(1)
local tool = script.Parent
local player = game.Players.LocalPlayer
local hum = player.Character.Humanoid
tool.Equipped:connect(function(mouse)
game:GetService("RunService").RenderStepped:connect(function()
if not hum.Parent:FindFirstChild(tool.Name) then
hum:EquipTool(tool)
end
end)
end)
then add an “if” statement to the tool.Equipped function you already have
i wrote this in the dev forum btw, might have a syntax error or something
wait(1)
local tool = script.Parent
local player = game.Players.LocalPlayer
local hum = player.Character.Humanoid
local Tool2Equipped
tool.Equipped:connect(function(mouse)
game:GetService("RunService").RenderStepped:connect(function()
if not hum.Parent:FindFirstChild(tool.Name) and Tool2Equipped == false then
hum:EquipTool(tool)
end
end)
end)
tool2.Equipped:connect(function()
Tool2Equipped = true
end)
tool2.Unequipped:connect(function()
Tool2Equipped = false
end)