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

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

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

✓ Accepted answer

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)

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