I Wanted When A Rock Touches This Part It Will Get A Random Mesh But It Won't Work Any Suggestions???
meshid = {{"http://www.roblox.com/asset/?id=51226819"},
{"http://www.roblox.com/asset/?id=29498610"},
{"http://www.roblox.com/asset/?id=12137531"},
{"http://www.roblox.com/asset/?id=24102084"},
{"http://www.roblox.com/asset/?id=9419831"}}
function onTouched(hit)
meshmaking = instance.new("SpecialMesh")
meshmaking.Name = "Mesh"
meshmaking.MeshType = "FileMesh"
meshmaking.MeshId = (math.random(1, #meshid))
mesh = meshmaking:clone()
if hit.Name == "Rock" then
mesh.Parent = hit
hit.Name = "MeshedRock"
end
end
script.Parent.Touched:connect(onTouched)

1 comment
I don't think you have to put all these meshid's in curly brackets, just one at start and one at the end.