local cannonBall = Instance.new("Part")
cannonBall.Name = "CannonShot"
-- this is the part i want the mesh in
local Mesh = Instance.new( "SpecialMesh", game.Workspace.CannonShot)
--this is the mesh
--Try this local cannonBall = Instance.new("Part") cannonBall.Name = "CannonShot" cannonBall.Parent = game.Worskapce -- this is the part i want the mesh in local Mesh = Instance.new( "SpecialMesh", cannonBall) --this is the mesh
You have it all correct. What I did was directly input the Mesh inside of the Part. Other parts in Workspace can be named "CannonShot", so it's better to use the variable.
local cannonBall = Instance.new("Part", Workspace) -- this is the part i want the mesh in cannonBall.Name = "CannonShot" --this is the mesh local Mesh = Instance.new( "SpecialMesh", cannonBall) -- You can input the variable