Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How would i make this machine change parts into meshes?

Asked by
22To 70
9 years ago

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

Log in to vote
0
Answered by
iFlusters 355 Moderation Voter
9 years ago

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)
0
thanks! 22To 70 — 9y
0
No Problem. iFlusters 355 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

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.

0
yea but the machine still wont operate 22To 70 — 9y

Answer this question