No really as I am trying to make it do it by itself. I know it is a simple change if you want to do it on touch. It is fine if you could tell me how. But I don’t know if it’s the function.
Hey there,
Could you please elaborate on what the script does? It will give us a sense of what is meant for, and it will help us put the script into context.
local part = workspace.part1
local function colorChange()
part.Material = Enum.Material.Neon
wait(1)
part.Material = Enum.Material.Wood
wait(1)
end
while true do
colorChange()
end
Alright, I couldn’t really decipher what you were trying to code but, this will change the part material every second.
local function colorChange()
part.Material = Enum.Material.Neon
wait(1)
part.Material = Enum.Material.Wood
wait(1) -- Hello there I'm new!
end
while true do -- Use a while loop instead
colorChange()
end
Functions are just used to help clean up code and call it to execute things easier. I don’t think it is super necessary here as well, but as long as it doesn’t make bad practice, you are fine.