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

Can someone tell me why this Instance.new for a meshpart script isnt working?

Asked by 6 years ago
Edited 6 years ago

I am creating a game and I want to add a MeshPart using instance.new but we all know that when we create a meshpart using Instance.new is going to put the Id at 0 so I added this under the Instance.new script: part.MeshId = ("694456873") if it was a normal script it would work but I have a bigger script that's why the script (i think) didn't worked. here's the script:

~~~~~~~~~~~~~~~~~ wait(2) workspace:WaitForChild("PartStorage")

deb = true script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat) if deb == true then deb = false local part = Instance.new("MeshPart",workspace.PartStorage) part.BrickColor=script.Parent.Parent.Parent.DropColor.Value part.Material=script.Parent.Parent.Parent.MaterialValue.Value part.MeshId = ("694456873") local cash = Instance.new("IntValue",part) cash.Name = "Cash" cash.Value = 1 part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0) part.FormFactor = "Custom" part.Size=Vector3.new(1, 1, 1) part.TopSurface = "Smooth" part.BottomSurface = "Smooth" game.Debris:AddItem(part,40) wait(5) deb = true end end)

~~~~~~~~~~~~~~~~~

0
oops Pizza64X 8 — 6y

2 answers

Log in to vote
0
Answered by
GingeyLol 338 Moderation Voter
6 years ago

Use code block please. Also Instance.new("IntValue",part) is depecrated.

0
I tried to but it didnt worked Pizza64X 8 — 6y
0
Its not depreciated, its just slower, a lot slower. Xetrax 85 — 6y
Ad
Log in to vote
0
Answered by
Xetrax 85
6 years ago

Meshparts are interesting, you can't set their MeshId in-game or by script, it has to be set manually, I'd say your best bet is to make the meshpart and store it in ReplicatedStorage, then just use game:GetService("ReplicatedStorage"):WaitForChild("MeshPartName"):Clone() Or something along those lines.

Also, with the Code Block, you have to highlight your code, and then click the "Code Block" button.

0
oh Pizza64X 8 — 6y
0
Yeah he is correct just tested it gr3uh 16 — 3y

Answer this question