This script is made to where you hit a brick, a figure and sound plays. I'm having trouble on how to script intervals of wait times. So when you hit the brick it plays sound and shows the figure for a second or so, then make a 30 second period where the script wont activate when hitting the brick. Here's the script. Your help would make my day a lot better lol
Switcher = script.Parent Figure = script.Parent.Parent.theFigure
function onTouched(Switcher) local boolean = true if boolean == true then Figure.Head.Transparency = .7 Figure.Head.CanCollide = false Figure.Torso.Transparency = .7 Figure.Torso.CanCollide = false Figure.Part1.Transparency = .7 Figure.Part1.CanCollide = false Figure.Part2.Transparency = .7 Figure.Part2.CanCollide = false Figure.Part3.Transparency = .7 Figure.Part3.CanCollide = false Figure.Part4.Transparency = .7 Figure.Part4.CanCollide = false script.Parent.Sound:Play()
boolean = false wait(.5) Figure.Head.Transparency = 1 Figure.Head.CanCollide = false Figure.Torso.Transparency = 1 Figure.Torso.CanCollide = false Figure.Part1.Transparency = 1 Figure.Part1.CanCollide = false Figure.Part2.Transparency = 1 Figure.Part2.CanCollide = false Figure.Part3.Transparency = 1 Figure.Part3.CanCollide = false Figure.Part4.Transparency = 1 Figure.Part4.CanCollide = false script.Parent.Sound:Play() boolean = true end end
script.Parent.Touched:connect(onTouched)

1 comment
Please put your code in a .lua code block.