-
What do you want to achieve?
Use a button to change the decal -
What is the issue?
Updates the url/id in the field, but doesnt update it. -
What solutions have you thought of so far?
Tried using Image Label, Decal, anything. Also tried manually putting it in myself through studio explorer. Also tried using Content Provider
Basic Script to change the decal
image = 'rbxassetid://5933057626'
wait(5)
script.Parent.Image.Image = image
Actual Script
Local Script(Starts Remote Event)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DecalEvent = ReplicatedStorage:WaitForChild("SetDecal")
local decal = script.Parent.Parent.TDecal
local type = script.Name
script.Parent.MouseButton1Click:Connect(function()
DecalEvent:FireServer(type, decal.Text)
end)
Server Script(Executes Remote Event)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Storage = game:GetService("ServerStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("SetDecal")
local function SetDecal(p,t,d)
for _,v in pairs(game.Workspace.Icons:GetChildren()) do
if v.Name == t then
local texture = 'rbxassetid://'..d
v.Decal.Texture = texture
end
end
end
remoteEvent.OnServerEvent:Connect(SetDecal)
Any feedback is accepted.