Sorry if I'm bad at explaining.
This is my script.
function onTouched(hit) script.Parent.Parent.ARGH.Transparency = 1 script.Parent.Parent.ARGH.CanCollide= true wait(7.5) script.Parent.Parent.ARGH.Transparency= 1 script.Parent.Parent.ARGH.CanCollide= false end script.Parent.Touched:connect(onTouched)
After pressing the button, it should change the platform's color. After 7.5 seconds, it goes back to its original color.
I tried something like this to change its color.
script.Parent.Parent.Lite.Lite1.BrickColor = BrickColor.new(Color3.new(1, 1, 1))
However, it didn't work. I couldn't use union, because it says "unsolvable".
Any solutions? (Once again, sorry if it's too hard to understand, I'm really bad at explaining)
model = game.Workspace.Model for i,v in pairs(model:GetChildren()) do -- iterates through the children of the model if v:IsA("Part") then--if its a part v.BrickColor = BrickColor.new(Color1.new(1,1,1))--changes color end end
This version may seem a little long-winded, but basically when it fires, it will:
Set a debounce ( so the funciton only fires once at a time ).
Get a new - random colour for the model change into (You can set this colour to anything you want)).
Scan through the model for Parts.
3.1. Get the part's original colour, and make a copy of it (using a BrickColorValue).
3.2. Change the part's colour.
Wait 7.5 seconds.
Scan through the model for Parts again. 5.1. Change part's colour to original BrickColorValue.
Return Debounce to false.
local model = Workspace.Model -- Change path if neccesarry. function onTouched(hit) --1. if debounce then return end debounce = true --2. local newColour = BrickColor.Random() --3. for _,part in pairs(model:GetChildren()) do if part:IsA("BasePart") or part:IsA("UnionOperation") then --3.1. local bc = part:FindFirstChild("OriginalBrickColor") or Instance.new("BrickColorValue",part) bc.Name = "OriginalBrickColor" bc.Value = part.BrickColor --3.2. part.BrickColor = newColour end end --4 wait(7.5) --5 for _,part in pairs(model:GetChildren()) do if part:IsA("BasePart") or part:IsA("UnionOperation") then if part:FindFirstChild("OriginalBrickColor") then -- just incase. =] --5.1. part.BrickColor = part.OriginalBrickColor.Value end end end --6 debounce = false end script.Parent.Touched:connect(onTouched)