as shown in the title, i need help with this script, i tried a bit but they all failed, anyone able ot help out
I put a local script inside of the tool and wrote this.
script.Parent.Equipped:Connect(function() --// When the player equips the tools, the events will fire local player = game:GetService("Players").LocalPlayer --// Finds the player if player then --// Checks if the player is valid local targGui = player:WaitForChild("PlayerGui"):FindFirstChild("PUT THE NAME OF THE GUI YOU WANT HERE") --// Finds the targeted gui if targGui then --// Checks if the gui is valid targGui.Enabled = true --// Enables the gui end end end) script.Parent.Unequipped:Connect(function() --// When the player unequips the tool, the events will fire local player = game:GetService("Players").LocalPlayer --// Finds the player if player then --// Checks if the player is valid local targGui = player:WaitForChild("PlayerGui"):FindFirstChild("PUT THE NAME OF THE GUI YOU WANT HERE") --// Finds the targeted gui if targGui then --// Checks if the gui is valid targGui.Enabled = false --// Disables the gui end end end)
Make sure you change the name of the targeted gui where it says PUT THE NAME OF THE GUI YOU WANT HERE
Also make sure you have your gui disabled in starter gui and reset on respawn is enabled.
Hope this helped, if it didn't work let me know so I can fix it for you.
Remember: This is not a request site.