Issues - Tool Visibility in Roblox

I need some help, when I activate the tool it is not visible, how can I solve it?

localscript 1:

-- Referencia al ImageButton en el juego
local imageButton = script.Parent:WaitForChild("openGui")

-- Referencia a la GUI en ReplicatedStorage
local replicatedStorage = game:GetService("ReplicatedStorage")
local myGui = replicatedStorage:WaitForChild("GUITAR | ARTIST CARE"):Clone()

-- Variable para rastrear el estado de la GUI
local isGuiVisible = false

-- Función para abrir o cerrar la GUI
local function toggleGui()
	if isGuiVisible then
		-- Cerrar la GUI
		myGui.Parent = nil
		-- Abrir la GUI
		myGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

	-- Cambiar el estado
	isGuiVisible = not isGuiVisible

-- Conectar la función al evento MouseButton1Click del ImageButton

localscript 2:

local chooseElectricGuitar = script.Parent.Frame:WaitForChild("On/Off")
local isOn = false
local debounce = false

-- Reference to the ReplicatedStorage
local replicatedStorage = game:GetService("ReplicatedStorage")

	if not debounce then
		debounce = true

		-- Toggle the state and perform functionality
		if isOn then
			-- Perform actions when turning off
			print("Turning off...")
			-- You can add additional actions when turning off here
			-- Perform actions when turning on
			print("Turning on...")

			-- Retrieve the tool from ReplicatedStorage
			local electricGuitarTool = replicatedStorage:WaitForChild("ElectricGuitarTool2"):Clone()

			-- Equip the tool to the player's character when turning on
			electricGuitarTool.Parent = game.Players.LocalPlayer.Backpack

		-- Change the text based on the current state
		chooseElectricGuitar.Text = isOn and "Off" or "On"

		isOn = not isOn
		wait(0.5) -- You can adjust this value based on your needs to prevent debounce
		debounce = false
1 Like

Don’t think this is a script problem, rather the tool itself. Did you name the tools grip part “Handle”? Also if you did, parts that are not named “Handle” (There can only 1 be 1 handle) gotta be welded for it to not fall apart.

Also, use task.wait() and not wait().

1 Like


I tried task.wait(0.5) and it didn’t work but I’ll share a picture with you, this is how my tool is currently

Motor 6D is named handle, that won’t work. Name it something else. Use a weld constraint for the Blade meshpart. Also, don’t see why task.wait() would not work here, it’s not like you are calling threads, but whatever.


It worked! Thank you very much for the help :smiley: The next step will be to place that guitar on my player’s torso, any idea how I could do that? :smiley:

Yeah, you could tamper around with the tool grip property of the tool on a dummy using the tool, or you can just use a plugin that makes it 100x easier.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.