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)
Try
local MeshIds = {"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"} script.Parent.Touched:connect(function(Hit) if Hit.Name == "Rock" then local Mesh = Instance.new("Mesh", Hit) Mesh.MeshType = "FileMesh" Mesh.MeshId = MeshIds[math.random(1,#MeshIds)] Hit.Name = "MeshedRock" end end)