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

How to change the texture for a mesh? (dropper tycoon)

Asked by 8 years ago

Okay, so I am making a tycoon, and I need the droppers to drop potatoes, which I have done. Now I just need the texture for it. Here's what I tried to use:

Here is the code for the dropper so far.

01wait(2)
02workspace:WaitForChild("PartStorage")
03 
04 
05deb = true
06script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat)
07    if deb == true then
08        deb = false
09    local part = Instance.new("Part",workspace.PartStorage)
10    part.BrickColor= BrickColor.new ("Gold")
11    part.Material=script.Parent.Parent.Parent.MaterialValue.Value
12            local mesh = Instance.new("SpecialMesh")
13            mesh.Parent = part
14            mesh.MeshType = "FileMesh"
15            mesh.MeshId = "rbxassetid://81684482"
View all 30 lines...
0
Texture is misspelled in line 16. Recreated your method. It should be working after you fix that spelling error. TofuBytes 500 — 8y
0
Oh, right... of course... umm, yeah, slightly embarrassing. haha thanks Pot8o_Penguin 50 — 8y
0
So now the potato is gray. Pot8o_Penguin 50 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

A meshId can only be set in the property panel, so it is staying grey because the script is unable to change the texture unfortunately.

You should be able to use a special mesh and change the ID from a script, though:

http://wiki.roblox.com/index.php?title=API:Class/SpecialMesh

Hope that helps!

EDIT: Oh, just realised you are using a special mesh. Try the ID in a mesh normally, and if it is still grey, subtract 1 from the end and so on, until you get the right texture! Then you can use that ID!

1
Thanks! Pot8o_Penguin 50 — 8y
Ad

Answer this question