How do I make it so when this brick gets hit and after all of its properties change, the next brick's script gets enabled.
Context: Brick 1 is named "Front" and Brick 2 is named "FD1". Also, the script for "FD1" is disabled in properties. This is for a crash physics script.
All of these parts are grouped together.
Script inside Front/Brick1
local DentSpeed = 40
local id = 1
script.Parent.Touched:Connect(function(part)
if part.Parent == script.Parent.Parent then
wait()
else
end
local Seat = script.Parent.Parent.VehicleSeat
if Seat.Velocity.Magnitude >= DentSpeed then
wait(.25)
script.Parent.Transparency = 1
script.Parent.CanCollide = false
script.Parent.Parent.FD1.Transparency = 0
script.Parent.Parent.FD1.CanCollide = true
Seat.Sound.Volume = 2
Seat.Sound.MaxDistance = 1000
Seat.Sound:Play()
wait(5)
script.Parent.Parent.FD1.script.Disabled = false
wait (1)
script.Parent:Destroy()
end
end)
^ Basically it changes some of the properties in the next brick, so when the next brick is hit it can change properties in the next brick.
Script inside FD1
local DentSpeed = 40
local id = 1
script.Parent.Touched:Connect(function(part)
if part.Parent == script.Parent.Parent then
wait()
else
end
local Seat = script.Parent.Parent.VehicleSeat
if Seat.Velocity.Magnitude >= DentSpeed then
wait(.25)
script.Parent.Transparency = 1
script.Parent.CanCollide = false
script.Parent.Parent.FD2.Transparency = 0
script.Parent.Parent.FD2.CanCollide = true
Seat.Sound.Volume = 2
Seat.Sound.MaxDistance = 1000
Seat.Sound:Play()
end
end)

2 comments
I have to do all that just to enable another brick's script?
Kind of