Hi scripters,
I am struggling to find out how to make a GUI button change colour when a certain Tool has been found in the players backpack. I am a beginner at scripting.
Hi scripters,
I am struggling to find out how to make a GUI button change colour when a certain Tool has been found in the players backpack. I am a beginner at scripting.
You can check when an instance (the tool) has been added into the backpack using ChildAdded. If the instance matches what you’re looking for, then you can color the button accordingly.
Hi,
Thanks for your reply can you give me and example on how I should write the script?
This isn’t complete code, but it illustrates the idea of my previous reply.
game:GetService("Players").LocalPlayer.Backpack.ChildAdded:Connect(function(child)
if child and child.Name == --[[Whatever tool name--]] then
-- Color GUI element here
end
end)
So if the player has a tool named “Apple Noob” You want the button gui to be completely destroyed. And what does it say into the output when you test this?
It doesn’t say anything in the Output
Ok, so in the code after if and then statement
before the button is destroyed put Print("Found")
then after destroyed put it after the button being destroyed Print("Was Destroyed")
put the first print(“found”) On a new line otherwise it won’t work as well, indenting and putting your codes on different lines are very important.