Concept: Change the mesh when a player touches the brick script:
function touched() Instance.new("SpecialMesh", script.Parent) script.Parent:WaitForChild(SpecialMesh) script.Parent.SpecialMesh.MeshID = "921414861" end script.Parent.Touched:Connect(touched)
EDIT: So i changed it to ("SpecialMesh")
and now it says Infinite yield possible on 'Workspace.Part:WaitForChild("SpecialMesh")'
The parental argument of Instance.new()
was deprecated, using it causes a lot of issues that are plain nuisances. For this case, it's caused an issue with referencing the Object. It's said that for now, too avoid these inconvenient problems, just declare the secondary argument outside the function.
Another note: You can also pin the allocation of the Instance within a variable, so that will be eaiser to work with as well.
local Part = script.Parent function onTouch(hit) local sMesh = Instance.new("SpecialMesh"); sMesh.Parent = Part sMesh.MeshId = "rbxassetid://921414861" end Part.Touched:Connect(onTouch)