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

If I am making a script that shoots a Laser using "part" how can I change the appearance?

Asked by 10 years ago

This is just a review on what one of the Functions look like. I'm being taught how to use Functions and other forms of Lua Code, I just need to learn how to change "Part" into any other Mesh, so it looks different. Basically I just want to know how to change the "Part" into any other mesh, so it doesn't just look like a square item.

function drawRay(pos, pos2,firecframe) f = Instance.new("Part",workspace) f.Transparency = 1 f.CanCollide = false f.Anchored = true f.CFrame = firecframe if firebeam then fire = Instance.new("Fire",f) fire.Size = 5 end

Thanks for helping.

2 answers

Log in to vote
0
Answered by
reaper5 10
10 years ago

Check the Basic Objects for other meshes/mesh-types you may like.

a = Instance.new("Part",Workspace)
b = Instance.new("BlockMesh",a)
0
Failed to see the edit Alessandro. reaper5 10 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

@reaper5 please, don't edit after I correct you....STILL not working, BlockMesh DOESN'T exist You need to declare a variable mesh and assign to it the values: If you want to make a cylinder then:

local mesh = Instance.new("CylinderMesh", f)
mesh.Name = "LaserMesh"

otherwhise, if you want special meshes use this:

local mesh = Instance.new("SpecialMesh", f)
mesh.Name = "LaserMesh"

and assign to it the mesh you want like this:

mesh.MeshType = "Head"
-- or
mesh.MeshType = "Cylinder"

Look at the mesh properties for accessing to the correct data =)

Answer this question