Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would i make this machine change parts into meshes?

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) 

2 answers

✓ Accepted answer

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)

2 comments

0

thanks!

0

No Problem.

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.

1 comment

0

yea but the machine still wont operate

This discussion is preserved as it was. New answers, comments, and votes are closed.