I'm really bad at scripting. This is supposed to be a script that causes a plate to turn neon/white when it's touched, then turn back to what it was originally (slate/black) after one second after it isn't being touched. Am I missing something, or did I completely do one of the properties wrong?
local function PlayerTouched(Part) local Parent = Part.Parent if game.Players:GetPlayerFromCharacter(Parent) then script.Parent.Material = "Neon" script.Parent.Color = "Institutional white" wait(1) script.Parent.Material = Slate script.Parent.Color = "Black" script.Parent.Touched:connect(PlayerTouched)
Where's the end statement?
local function PlayerTouched(Part) local Parent = Part.Parent if game.Players:GetPlayerFromCharacter(Parent) then script.Parent.Material = "Neon" script.Parent.Color = "Institutional white" wait(1) script.Parent.Material = Slate script.Parent.Color = "Black" end end script.Parent.Touched:connect(PlayerTouched)
You could also do it like this:
local Plate = script.Parent --Put whatever you name you want instead of plate. local function SteppedOn(part) local Parent = part.Parent if game.Players:GetPlayerFromCharacter(Parent) then Plate.Material = "Neon" Plate.BrickColor = BrickColor.new("Institutional white") wait(1) Plate.Material = "Slate" Plate.BrickColor = BrickColor.new("Black") end end Plate.Touched:Connect(SteppedOn)
If u don’t want to get spammed or like something?
Local used = false local function PlayerTouched(Part) local Parent = Part.Parent if game.Players:GetPlayerFromCharacter(Parent) then If used == false then used = true script.Parent.Material = "Neon" script.Parent.Color = "Institutional white" wait(1) used = false script.Parent.Material = Slate script.Parent.Color = "Black" end end script.Parent.Touched:connect(PlayerTouched)