Hello all,
How do I script like, with the invisible wall if an elevator touches there the material of part should go Neon and if elevator goes up or down it should go to smooth plastic.
Hello all,
How do I script like, with the invisible wall if an elevator touches there the material of part should go Neon and if elevator goes up or down it should go to smooth plastic.
I might know the answer to this, but your goal is really unclear. Can you rephrase this?
thanks
Use the Touched event to change the color of a certain part if it comes into contact with the invisible part. You can then use the TouchEnded event to change the color back once the parts aren’t touching any more.
You can use the .Touched
event. Simply insert a Script into the part you would like to change color (it’s up to preference in the end, it can be almost anywhere), reference the part
local Part = script.Parent
Part.Touched:Connect(function(Hit)
if Hit.Parent.Name == "Elevator" then
Part.Material = Enum.Material.Neon
end)
This is considering the elevator is named Elevator and the script is in the part you want to change color of.
Keep in mind, if your elevator is a single part you might want use Hit.Name
instead of Hit.Parent.Name