Hello, this is my second try on making a script from various tutorials on YouTube, and this time, I have just learned about events. What am I trying to do is that I want the script to make the part glow (changes to a Neon material) only if a player is touching it, and not other objects (e.g. the Baseplate). I am trying to figure out on how to do this, but it seems like I don't know how so maybe I'll seek for help in this forum. I also want it so that the part only glows as long as the player touches it (walking on it), and reverts back to it's default material once the player no longer touches the part.
Here is the script that I made in an attempt to make the thing I wanted above:
local Glow = script.Parent
local PartTouched = false
Glow.Touched:Connect(function()
if PartTouched == false then
PartTouched = true
Glow.BrickColor = BrickColor.new("Lime green")
Glow.Material = Enum.Material.Neon
end
end)