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

Help with a OnJoined decal changer? Cant seem to get it to work

Asked by 7 years ago

Henlo friends, Ive been working on this script to disguise a decal when two of these players are in game, but it doesnt seem to work. Anyone know how to help? Any help is appreciated

local PreviousDecal = game.Workspace.EmptyThing:FindFirstChild("Decal")
if PreviousDecal then PreviousDecal:Destroy() end -- So theres only 1

local MyaD = Instance.new("Decal")
MyaD.Parent = game.Workspace.EmptyThing
MyaD.Texture = 617687888
game.Workspace.EmptyThing.Transparency = 0
MyaD.Face = "Front"

game.Players.PlayerAdded:connect(function(p)
    if p.UserId == 17408797 or 4134651 then
    local Mya = game.Workspace.EmptyThing:FindFirstChild("Decal")
    MyaD.Texture = 31490184
    end
end)


game.Players.PlayerRemoving:connect(function()
    for _, p in pairs(game.Players:GetChildren()) do
        if p.UserId == 17408797 or 4134651 then
            return true
        end
    end
    local Mya = game.Workspace.EmptyThing:FindFirstChild("Decal")
    MyaD.Texture = 617687888
end)

Answer this question