I'm trying to make the brick named Ball turn into the Beachball mesh when it touches the brick this script is in but other bricks not named Ball keep turning into the Beachball mesh also. How do I make that stop?
z = script.BeachBallMesh function onTouched(Ball) z = z:clone() z.Parent = Ball end script.Parent.Touched:connect(onTouched)
You can just make sure the brick named "Ball" is the only one that gets the mesh with an if statement
z = script.BeachBallMesh function onTouched(Ball) if(Ball.Name == "Ball") then --check if the name of the part that touched is "Ball" z = z:clone() z.Parent = Ball end end script.Parent.Touched:connect(onTouched)