#Hello, simple problem for u guys probably

1 messages · Page 1 of 1 (latest)

pastel nymph
#

I am making it so when the part it touched it changes colours, then after a few seconds it changed colours again. I want to make it so if the part is touched during the task.wait, it wont change colour, but if it is it will

local part = workspace.touchPart

part.Touched:Connect(function(hit)
print("part touched")
print(hit)
part.BrickColor = BrickColor.new("Bright green")
task.wait(2)
part.BrickColor = BrickColor.new("Bright red")
end)

rustic rune
#
local part = workspace.touchPart
local de = false

part.Touched:Connect(function(hit)
    if not de then
        de = true
        print("part touched")
        print(hit)
        part.BrickColor = BrickColor.new("Bright green")
        task.wait(2)
        part.BrickColor = BrickColor.new("Bright red")
        de = false
    end
end)```
#

brah