I made a machine that would change the anypart that touch it into a fedora but i want the machine to change the mesh to a tophat when a part touch it and i want it to do this pattern over and over here is the script. I Tried
B = script.Mesh function onTouched(part) BC = B:clone() BC.Parent = part script.Parent.CanCollide = false then wait(0.2) script.Mesh.ChangeMeshId.http://www.roblox.com/asset/?id=162384581 script.Mesh.ChangeTextureId.http://www.roblox.com/asset/?id=162384608 BC.Parent = part script.Parent.CanCollide = false then wait(0.2) script.Mesh.ChangeMeshId.http://www.roblox.com/asset/?id=------NEW ID script.Mesh.ChangeTextureId.http://www.roblox.com/asset/?id=-----NEW ID ----THEN IT WILL DO THIS OVER and OVER end script.Parent.Touched:connect(onTouched)
Two problems with the script ChangeMeshId
and ChangeTextureId
do not exist. You also put:
script.Parent.CanCollide = false then -- Only use then in 'if' or 'while' statements, as the script will automatically run through the script.
I've corrected your script, it should be working now.
B = script.Mesh function onTouched(part) BC = B:clone() BC.Parent = part script.Parent.CanCollide = false -- Then is not needed. wait(0.2) script.Mesh.MeshId = "http://www.roblox.com/asset/?id=162384581" script.Mesh.TextureId = "http://www.roblox.com/asset/?id=162384608" BC.Parent = part script.Parent.CanCollide = false -- Then is not needed. wait(0.2) script.Mesh.MeshId = "http://www.roblox.com/asset/?id=" script.Mesh.TextureId = "http://www.roblox.com/asset/?id=" ----THEN IT WILL DO THIS OVER and OVER end script.Parent.Touched:connect(onTouched)
You need to do this:
script.Mesh.MeshId="http://www.roblox.com/asset/?id=162384581" script.Mesh.TextureId="http://www.roblox.com/asset/?id=162384608"
There isn't any instances or anything like ChangeMeshId or ChangeTextureId When you change something like a texture of a decal or mesh, it needs to be in a string.