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

How do you change this code allowing it to replace"BlockMesh" with any other?

Asked by 10 years ago

I don't understand how to change this piece of code, please help. I basically want it to be anything other than a "Block Mesh". Whenever I change it the it breaks the rest of the script immediately. Thanks for the help. Me and a few people are having trouble edit a few scripts.

game.Debris:AddItem(f,0.2) p = Instance.new("Part", Workspace) p.CanCollide = false p.Size = Vector3.new(.2,.2,.2) p.Anchored = true game.Debris:AddItem(p, 0.2) p.CFrame = CFrame.new(pos, pos2) p.Transparency = transparency p.BrickColor = beamcolor p.formFactor = "Custom" m = Instance.new("BlockMesh", p) m.Scale = Vector3.new(thickness, thickness, (pos - pos2).magnitude) m.Offset = Vector3.new(0,0,(pos - pos2).magnitude/-2)

1 answer

Log in to vote
0
Answered by 10 years ago

You didn't say what kind of mesh/object you wanted to create, but this is what you have to note:

game.Debris:AddItem(f,0.2) 
p = Instance.new("Part", Workspace) 
p.CanCollide = false 
p.Size = Vector3.new(.2,.2,.2) 
p.Anchored = true 
game.Debris:AddItem(p, 0.2) 
p.CFrame = CFrame.new(pos, pos2) 
p.Transparency = transparency 
p.BrickColor = beamcolor 
p.formFactor = "Custom" 
m = Instance.new("BlockMesh", p) --Now if you change this to other kind of mesh, it should work fine, but when you try to create other object like fire, you should get ride of both following lines and change properties you want to.
m.Scale = Vector3.new(thickness, thickness, (pos - pos2).magnitude)
m.Offset = Vector3.new(0,0,(pos - pos2).magnitude/-2)
Ad

Answer this question