I've recently been trying to add texture to all sides of nearby parts, I also have been trying to add texture to parts that may be inside nearby models. For some reason the textures are only added directly to the model itself when ran. Is there any way I can get my script to work?
me = game.Players.LocalPlayer.Character
bin = script.Parent
function onButton1Down(mouse)
if not enabled then
return
end
local player = game.Players.LocalPlayer
if player == nil then return end
enabled = false
for u, c in pairs(workspace:GetChildren()) do
h = workspace:GetChildren()
t = c:findFirstChild("Torso")
if h ~= nil and t ~= nil then
for i = 1, #h do
if h[i]:IsA("Model") then
X = h[i]:GetChildren()
for i = 1, #X do
if X[i]:IsA("Model") then
Z = X[i]:GetChildren()
for i = 1, #X do
if X[i]:IsA("Part") or X[i]:IsA("UnionOperation") then
if (X[i].Position-t.Position).magnitude <= 60 then
if (X[i].Position-t.Position).magnitude >= 60 then return end
if X[i]:IsA("Part") or X[i]:IsA("UnionOperation") then
print("bruh")
for i = 1, #X do
A = Instance.new("Texture")
A.Texture = "http://www.roblox.com/asset/?id=108208815"
A.StudsPerTileV = 2
A.StudsPerTileU = 2
A.Face = "Top"
A.Transparency = 0.2
A.Parent = X[i]
B = Instance.new("Texture")
B.Texture = "http://www.roblox.com/asset/?id=108208815"
B.StudsPerTileV = 2
B.StudsPerTileU = 2
B.Face = "Bottom"
B.Transparency = 0.2
B.Parent = X[i]
C = Instance.new("Texture")
C.Texture = "http://www.roblox.com/asset/?id=108208815"
C.StudsPerTileV = 2
C.StudsPerTileU = 2
C.Face = "Front"
C.Transparency = 0.2
C.Parent = X[i]
D = Instance.new("Texture")
D.Texture = "http://www.roblox.com/asset/?id=108208815"
D.StudsPerTileV = 2
D.StudsPerTileU = 2
D.Face = "Back"
D.Transparency = 0.2
D.Parent = X[i]
E = Instance.new("Texture")
E.Texture = "http://www.roblox.com/asset/?id=108208815"
E.StudsPerTileV = 2
E.StudsPerTileU = 2
E.Face = "Left"
E.Transparency = 0.2
E.Parent = X[i]
F = Instance.new("Texture")
F.Texture = "http://www.roblox.com/asset/?id=108208815"
F.StudsPerTileV = 2
F.StudsPerTileU = 2
F.Face = "Right"
F.Transparency = 0.2
F.Parent = X[i]
wait(.15)
end
for i = 1, #Z do
if Z[i]:IsA("BasePart") or Z[i]:IsA("UnionOperation") then
print("test")
if (Z[i].Position-t.Position).magnitude <= 60 then
if (Z[i].Position-t.Position).magnitude >= 60 then return end
if Z[i]:IsA("BasePart") or Z[i]:IsA("UnionOperation") then
for i = 1, #Z do
G = Instance.new("Texture")
G.Texture = "http://www.roblox.com/asset/?id=108208815"
G.StudsPerTileV = 2
G.StudsPerTileU = 2
G.Face = "Top"
G.Transparency = 0.2
G.Parent = Z[i]
H = Instance.new("Texture")
H.Texture = "http://www.roblox.com/asset/?id=108208815"
H.StudsPerTileV = 2
H.StudsPerTileU = 2
H.Face = "Bottom"
H.Transparency = 0.2
H.Parent = Z[i]
L = Instance.new("Texture")
L.Texture = "http://www.roblox.com/asset/?id=108208815"
L.StudsPerTileV = 2
L.StudsPerTileU = 2
L.Face = "Front"
L.Transparency = 0.2
L.Parent = Z[i]
M = Instance.new("Texture")
M.Texture = "http://www.roblox.com/asset/?id=108208815"
M.StudsPerTileV = 2
M.StudsPerTileU = 2
M.Face = "Back"
M.Transparency = 0.2
M.Parent = Z[i]
N = Instance.new("Texture")
N.Texture = "http://www.roblox.com/asset/?id=108208815"
N.StudsPerTileV = 2
N.StudsPerTileU = 2
N.Face = "Left"
N.Transparency = 0.2
N.Parent = Z[i]
O = Instance.new("Texture")
O.Texture = "http://www.roblox.com/asset/?id=108208815"
O.StudsPerTileV = 2
O.StudsPerTileU = 2
O.Face = "Right"
O.Transparency = 0.2
O.Parent = Z[i]
wait(.15)
end
print("yo")
if Z[i]:IsA("Model") then
K = Z[i]:GetChildren()
for i = 1, #K do
if K[i]:IsA("BasePart") or K[i]:IsA("UnionOperation") then
if (K[i].Position-t.Position).magnitude <= 60 then
if (K[i].Position-t.Position).magnitude >= 60 then return end
if K[i]:IsA("BasePart") or K[i]:IsA("UnionOperation") then
for i = 1, #K do
AA = Instance.new("Texture")
AA.Texture = "http://www.roblox.com/asset/?id=108208815"
AA.StudsPerTileV = 2
AA.StudsPerTileU = 2
AA.Face = "Top"
AA.Transparency = 0.2
AA.Parent = K[i]
BB = Instance.new("Texture")
BB.Texture = "http://www.roblox.com/asset/?id=108208815"
BB.StudsPerTileV = 2
BB.StudsPerTileU = 2
BB.Face = "Bottom"
BB.Transparency = 0.2
BB.Parent = K[i]
CC = Instance.new("Texture")
CC.Texture = "http://www.roblox.com/asset/?id=108208815"
CC.StudsPerTileV = 2
CC.StudsPerTileU = 2
CC.Face = "Front"
CC.Transparency = 0.2
CC.Parent = K[i]
DD = Instance.new("Texture")
DD.Texture = "http://www.roblox.com/asset/?id=108208815"
DD.StudsPerTileV = 2
DD.StudsPerTileU = 2
DD.Face = "Back"
DD.Transparency = 0.2
DD.Parent = K[i]
EE = Instance.new("Texture")
EE.Texture = "http://www.roblox.com/asset/?id=108208815"
EE.StudsPerTileV = 2
EE.StudsPerTileU = 2
EE.Face = "Left"
EE.Transparency = 0.2
EE.Parent = K[i]
FF = Instance.new("Texture")
FF.Texture = "http://www.roblox.com/asset/?id=108208815"
FF.StudsPerTileV = 2
FF.StudsPerTileU = 2
FF.Face = "Right"
FF.Transparency = 0.2
FF.Parent = K[i]
print("hi")
wait(.15)
end
for i = 1, #X do
if X[i]:IsA("Part") or X[i]:IsA("UnionOperation") then
if (X[i].Position-t.Position).magnitude <= 60 then
print("not I")
if (X[i].Position-t.Position).magnitude <= 60 then return end
if X[i]:IsA("Part") or X[i]:IsA("UnionOperation") then
for i = 1, #X do
A = Instance.new("Texture")
A.Texture = "http://www.roblox.com/asset/?id=108208815"
A.StudsPerTileV = 2
A.StudsPerTileU = 2
A.Face = "Top"
A.Transparency = 0.2
A.Parent = X[i]
B = Instance.new("Texture")
B.Texture = "http://www.roblox.com/asset/?id=108208815"
B.StudsPerTileV = 2
B.StudsPerTileU = 2
B.Face = "Bottom"
B.Transparency = 0.2
B.Parent = X[i]
C = Instance.new("Texture")
C.Texture = "http://www.roblox.com/asset/?id=108208815"
C.StudsPerTileV = 2
C.StudsPerTileU = 2
C.Face = "Front"
C.Transparency = 0.2
C.Parent = X[i]
D = Instance.new("Texture")
D.Texture = "http://www.roblox.com/asset/?id=108208815"
D.StudsPerTileV = 2
D.StudsPerTileU = 2
D.Face = "Back"
D.Transparency = 0.2
D.Parent = X[i]
E = Instance.new("Texture")
E.Texture = "http://www.roblox.com/asset/?id=108208815"
E.StudsPerTileV = 2
E.StudsPerTileU = 2
E.Face = "Left"
E.Transparency = 0.2
E.Parent = X[i]
F = Instance.new("Texture")
F.Texture = "http://www.roblox.com/asset/?id=108208815"
F.StudsPerTileV = 2
F.StudsPerTileU = 2
F.Face = "Right"
F.Transparency = 0.2
F.Parent = X[i]
wait(.15)
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
enabled = true
end
enabled = true
function onS(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onS)
