(Unsolved) Question, Can You Code This? Vol.1

Hi, I’m Trying to make System that makes the frame white and then into a gray frame and back into a white frame, make the button go down a little then back up, and then add numbers into the backpack. here’s a script that shows what i’m talking about:

local BackPack = --need backpack code
local frame = script.Parent
local button = script.Parent.Parent
local function onButtonActivated()
	frame.BackgroundColor3 = Color3.fromRBG(150, 150, 150) --this isn't working
    --need code of going down
    --add 5 to backpack
    task.wait(0.5)
    frame.BackgroundColor3 = Color3.fromRBG(255, 255, 255) --this isn't working
    --need code of going up
end
button.Activated:Connect(onButtonActivated)

i would be glad if someone helped me.

To move the position of the button you would use TweenPosition().
Also you can’t add numbers to the backpack(as far as im aware), also why are you saying frame.BackgroundColor3? I remember just saying BackgroundColor and it works perfectly, but i have never used Color3.fromRGB so i can’t help you with that.

TweenPosition(UDim2.new("copy and paste the position you want it to go but delete the ()'s),EasingStyle,EasingDirection)
To acess the BackPack you would do player.Backpack:GetChildren, and as far as i’m aware, you can’t add numbers to it.

Please correct me if i’m wrong in something :skull:.

Yes, you’re wrong. It’s BackgroundColor3.

Yeah i actually expected it, sorry.

My suggestions and improvements:

Don’t use equal sign, it will mess the code.

To detect if a button is triggered you need to use button.MouseButton1Click for PC or button.TouchTap for Mobile, Tablet, etc.