Issue with tool

My issue is that my script doesnt work.

It is a gui that changes the handle of my tool but doesn’t work and gives me this error.

I don’t know why it happens, can someone help me ?

1 Like

This is probably because you only mentioned the tool in the Backpack, not the character. When you equip a tool, the tool moves to the character, and when its unequipped, it goes back to the backpack. So this is why you are getting this error.

Here is your fixed code:

local Gui = script.Parent
local Tool = Gui.Parent -- easily gets the Tool

local bontona = Gui.Frame:WaitForChild("azul")
local botonv = Gui.Frame:WaitForChild("verde")
local botonr = Gui.Frame:WaitForChild("rojo")

Gui.Enabled = false

Tool.Equipped:Connect(function()
	Gui.Enabled = true
end)

Tool.Unequipped:Connect(function()
	Gui.Enabled = false
end)

bontona.Activated:Connect(function()
	Tool:WaitForChild("Handle").BrickColor = BrickColor.new("Really blue")
end)

botonv.Activated:Connect(function()
	print("verde")
end)

botonr.Activated:Connect(function()
	print("rojo")
end)
1 Like


it gives me that error + gui doesnt work anymore

Can you post the script here instead of a screenshot? Thanks.


---sexy code---

local Gui = script.Parent

local Tool = Gui.Parent -- easily gets the Tool

local bontona = Gui.Frame:WaitForChild("azul")

local botonv = Gui.Frame:WaitForChild("verde")

local botonr = Gui.Frame:WaitForChild("rojo")

Gui.Enabled = false

Tool.Equipped:Connect(function()

Gui.Enabled = true

end)

Tool.Unequipped:Connect(function()

Gui.Enabled = false

end)

bontona.Activated:Connect(function()

Tool:WaitForChild("Handle").BrickColor = BrickColor.new("Really blue")

end)

botonv.Activated:Connect(function()

print("verde")

end)

botonr.Activated:Connect(function()

print("rojo")

end)```
--//Made by AlanRBLX

--//Put the gui inside the tool

wait(1)

Gui = script.Parent.ScreenGui --//Rename "Gui" with your gui's name

local Player = game.Players.LocalPlayer

script.Parent.Equipped:Connect(function()

local GuiClone = Gui:Clone()

GuiClone.Parent = Player.PlayerGui

script.Parent.Unequipped:Connect(function()

GuiClone:Remove()

end)

end)```
script gui shows on tools equipped