Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Hi How Do I Make A Brick Change It Color Once To Green And Back When Touched Only Once?

Asked by 3 years ago
Edited 3 years ago

How do i make a brick change its color when I touch it to any color I want then for about 1 second it changes back to its original color Only Once Not All the time

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago
partbeforecolor = script.Parent.Color3
debounce = false

script.Parent.Touched:Connect(function()
    if debounce == false then -- cooldown for spam
    debounce = true
    script.Parent.BrickColor = BrickColor:Green()
    wait(1)
    script.Parent.Color3 = Color3.new(partbeforecolor)
    debounce = false
    end
end) 
0
so i only need to but this as a local script or a just a normal script? kidsteve923 139 — 3y
0
any Xapelize 2658 — 3y
0
local script only u see like minecraft ender chest but script is minecraft chest only Xapelize 2658 — 3y
Ad

Answer this question