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

How do i prevent from decals not showing with scripts?[FIXED]

Asked by 2 years ago
Edited 2 years ago

Hey There,

So, I am basically trying to change a texture with scripts but I have encountered a problem.: The decal successfully changes on the decal.texture but it doesnt show on the real game,But when I insert the decal on the toolbox it suddenly works, Does anyone have a solution to this?

Also my code if someone needs it.

local Elevators = workspace:WaitForChild("Elevators")
local ElevatorsList = Elevators:GetChildren()
local RP = game:GetService("ReplicatedStorage")
local Maps = RP:WaitForChild("Maps")
local MapsList = Maps:GetChildren()

wait(10)

while true do
    for _, elevator in pairs(Elevators:GetChildren()) do
        spawn(function()
            if not elevator.Players:FindFirstChild("Player") then
                local randommap = MapsList[math.random(1, #MapsList)]
                local randomelevator = ElevatorsList[math.random(1, #MapsList)]
                if not randomelevator:FindFirstChild("Changed") then
                    Instance.new("IntValue",randomelevator).Name = "Changed"
                else
                    return
                end

                randomelevator.Decal2.Map.Texture = randommap.Decal.Value
                randomelevator.Text.SurfaceGui.SIGN.Text = randommap.Text.Value
            end
        end)
    end
    wait(30)
    for _,v in pairs(Elevators:GetChildren()) do
        if v:FindFirstChild("Changed") then
            v:FindFirstChild("Changed"):Destroy()
        end
    end
end

Can someone please tell me how to fix this?

0
i typed with instead of using lol BuildAboatTest124 51 — 2y

Answer this question