Hi!
I’m doing something that if the bool value (CanEquip) is false, you can’t equip any tool
LocalScript
local player = game.Players.LocalPlayer
local character
repeat
wait()
character = player.Character or player.CharacterAdded:Wait()
until character.Parent
--\\ CanEquip //--
character:WaitForChild("CanEquip").Changed:Connect(function()
if character.CanEquip.Value == false then
if character:FindFirstChildOfClass("Tool") then
character:FindFirstChildOfClass("Tool").Parent = game.Players:FindFirstChild(character.Name).Backpack
end
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
else
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end
end)
--\\ OnRespawn //--
player.CharacterAdded:Connect(function()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end)
--\\ OnRespawn //--
player.CharacterAdded:Connect(function()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end)
(No errors)
but when you reappear/Die and put the value back to false it doesn’t work
I know it is because the Character variable was not updated and I tried to fix it but i couldn’t : (