Generate Part
local model = Instance.new('Model')
model.Parent = game.Workspace
for j = 0, 9 do
for i = 0, 9 do
local part = Instance.new('Part')
part.Parent = model
part.Anchored = true
part.Size = Vector3.new(7, 2,7)
part.Position = Vector3.new(i * 10, 6, j * 10)
local chance = math.random(1,100)
if chance > 50 then
part.CanCollide = false
part.BrickColor = BrickColor.new('Really red')
end
end
end
Invisible
local TransPart = script.Parent
function setTransparency(char, value)
for _, child in pairs(char:GetChildren()) do
if child:IsA('Hat') and child:FindFirstChild("Handle") then
child = child.Handle
elseif child:IsA('BasePart') then
child.Transparency = value
end
end
end
local enabled = true
TransPart.Touched:connect(function(hit)
local char = hit.Parent
if char then
local head = char:FindFirstChild("Head")
local face = head:FindFirstChild("face")
if enabled and head and game.Players:GetPlayerFromCharacter(char) then
enabled = false
for t = 0, 1, .1 do
if face then face.Transparency = t end
setTransparency(char, t)
wait(0.1)
end
wait(10)
for t = 1, 0, -.1 do
if face then face.Transparency = t end
setTransparency(char, t)
wait(0.1)
end
wait(2)
enabled = true
end
end
end)