imR_otax
(imR_otax)
August 20, 2022, 4:26pm
#1
I know that there are many topic like this, however none of them worked for me.
I’m trying to change a MeshPart’s texture throught a Server Script (inside a ClickDetector). The texture changes, but there isn’t any visual effect.
MeshPart.TextureID = "rbxassetid://1234567890"
My only clue is that the texture isn’t loaded because of the error. I don’t know how to “load it”.
Any help appracticed!
2 Likes
Dfn150
(DevFunNewIdeas)
August 20, 2022, 4:38pm
#2
Is the 1234567890 ID the actual ID? Also, if you are using the InsertService, you can change textures without it.
1 Like
imR_otax
(imR_otax)
August 20, 2022, 4:44pm
#3
No that ID is just a placeholder, i am not using InsertService in any script.
If you aren’t using insert service, the error isn’t because of that. Can you show me what happens in the output when you try to load it? I once tried changing the texture of a meshpart with the dev console and I think it errored
nonamehd24
(nonamehd24)
August 20, 2022, 7:21pm
#5
The problem is that you can’t use InsertService on the Client. You need to use a Server Script instead.
imR_otax
(imR_otax)
August 20, 2022, 7:28pm
#6
Nothing happens in the output window. No errors. No warnings.
imR_otax
(imR_otax)
August 20, 2022, 7:30pm
#7
I’m not using Insert Service.
Please forget it. Could someone help with the texture not changing if possible?
try it, im not sure if its gonna work
(EDIT: accidently cut-off the image)
local image = "rbxassetid://10244612505"
local meshpart = script.Parent.Parent --put the meshpart here
script.Parent.MouseClick:Connect(function()
script.Parent.Parent.TextureID = image
end)
Zirkonir
(Zirkonir)
August 20, 2022, 8:05pm
#9
<Texture>.Texture
, not <Texture>.TextureID
, is it not?
Tl;dr “TextureId” isn’t a property in Texture
.
(Min characters)
imR_otax
(imR_otax)
August 20, 2022, 8:08pm
#10
MeshPart has “TextureID”, not “Texture”.
Zirkonir
(Zirkonir)
August 20, 2022, 8:10pm
#11
Have you tried setting it manually and see what it says?
imR_otax
(imR_otax)
August 20, 2022, 8:22pm
#12
What do you mean manually?
chlimit
Zirkonir
(Zirkonir)
August 20, 2022, 8:25pm
#13
In studio, go and set it as your desired ID.
imR_otax
(imR_otax)
August 20, 2022, 8:27pm
#14
Works obviously, its just that there is no visual change after the texture was changed (in-game).
imR_otax
(imR_otax)
August 20, 2022, 8:28pm
#15
Tried this already, doesn’t work.
can you show some parts of the script so i can look for the issue?
imR_otax
(imR_otax)
August 20, 2022, 8:34pm
#17
cookedTexture = "1203306754"
rawTexture = "1203306754"
local Meat1 = script.Parent.Parent.Parent.Meat1
local Meat2 = script.Parent.Parent.Parent.Meat2
local Meat3 = script.Parent.Parent.Parent.Meat3
local Meat4 = script.Parent.Parent.Parent.Meat4
local Machine = script.Parent.Parent.Parent.Machine
script.Parent.Triggered:Connect(function(player)
if player.leaderstats.Patties.Value >= 4 then
player.leaderstats.Patties.Value -= 4
script.Parent.MaxActivationDistance = 0
task.wait(0.2)
Meat1.Transparency = 0
task.wait(0.8)
Meat2.Transparency = 0
task.wait(1)
Meat3.Transparency = 0
task.wait(0.7)
Meat4.Transparency = 0
task.wait(1.5)
for i = 1,61 do
Machine:SetPrimaryPartCFrame(Machine.PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ(0.01,0,0))
task.wait()
end
task.wait(0.5)
game:GetService("TweenService"):Create(script.Parent.Parent.frying,TweenInfo.new(1),{Volume = 0.5}):Play()
script.Parent.Parent.frying:Play()
script.Parent.Parent.Parent.Smoke.Smoke.Enabled = true
task.wait(4)
-- // texture change
Meat1.TextureID = cookedTexture
Meat2.TextureID = cookedTexture
Meat3.TextureID = cookedTexture
Meat4.TextureID = cookedTexture
--//
task.wait(5)
game:GetService("TweenService"):Create(script.Parent.Parent.frying,TweenInfo.new(1),{Volume = 0}):Play()
task.wait(1)
script.Parent.Parent.frying:Stop()
script.Parent.Parent.Parent.Smoke.Smoke.Enabled = false
for i = 1,61 do
Machine:SetPrimaryPartCFrame(Machine.PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ(-0.01,0,0))
task.wait()
end
-- // tbc
end
end)
use specialmesh instead of meshpart, might work better.
imR_otax
(imR_otax)
August 20, 2022, 8:43pm
#19
The path seems to be correct. I don’t know why it errors.
change TextureID to TextureId, chat limit be like lolololo