Hello, DevFourm! I a currently working on a game where you can spawn a part and you can customize it to your liking. I include the option to add certain instances to the part like Explosions, Sparkles, etc. I have recently added a feature where you can add decals and Particle Emitters and change the Texutre for them. However, when I change the texture of the decal, I change the texture of the Particle Emitter as well.
Here is a video:
The Script that the “Apply” button uses:
Remove Event Script:
(In A LocalScript)
local Event = game.ReplicatedStorage.DecalImageChange
local TextBox = script.Parent.Parent.TextBox
local Button = script.Parent
Button.MouseButton1Click:Connect(function()
Event:FireServer(TextBox.Text)
TextBox.Text = ""
wait(0.3)
TextBox.PlaceholderText = "Loading..."
wait(3)
TextBox.PlaceholderText = ""
end)
Button Script:
local Event = game.ReplicatedStorage.DecalImageChange
local Part = game.Workspace:WaitForChild("Color_Part")
Event.OnServerEvent:Connect(function(plr, event)
local Decal = Part:FindFirstChild("Decal")
Decal.Texture = string.format("rbxthumb://type=Asset&id=%s&w=768&h=432", event)
end)
Thanks ![]()