So, i created a "Part" with a script:
local clickdetector = script.Parent:WaitForChild("ClickDetector") clickdetector.MouseClick:Connect(function() game.Workspace.MEDIUM2.Transparency = 1 game.Workspace.MEDIUM2.Position = Vector3.new(0,0,0) local part = Instance.new("Part") part.Position = Vector3.new(0,0,0) part.Name = "COLORCHANGE" part.Parent = game.Workspace part.Size = Vector3.new(100,100,100) wait(3) game.Workspace.MEDIUM2.Transparency = 0 game.Workspace.MEDIUM2.Position = Vector3.new(121.199, 100, -309.035) end)
And when i try to modify the Material of the "COLORCHANGE" it doesn't works. The script:
local clickdetector = script.Parent:WaitForChild("ClickDetector") clickdetector.MouseClick:Connect(function() game.Workspace.Medium3.Transparency = 1 game.Workspace.Medium3.Position = Vector3.new(0,0,0) part = game.Workspace.COLORCHANGE part.Material="Neon" game.Workspace.Medium3.Transparency = 0 game.Workspace.Medium3.Position = Vector3.new(98.199, 100, -309.035) end)
Why is the script not working?
Here's one way to do it, I think this might help you a little.
local clickdetector = script.Parent:WaitForChild("ClickDetector") clickdetector.MouseClick:Connect(function() script.Parent.Material = Enum.Material.Neon end)