Full Script
local replicatedStorage = game:FindFirstChild("ReplicatedStorage")
local folder = replicatedStorage:WaitForChild("BradyThings")
local island1 = folder["Floating island #1"]:Clone()
local island2 = folder["Floating island #2"]:Clone()
local island3 = folder["Floating island #3"]:Clone()
local island4 = folder["Floating island #4"]:Clone()
local rose2 = folder["Rose #2"]:Clone()
local rose3 = folder["Rose #3"]:Clone()
local rose4 = folder["Rose #4"]:Clone()
local rose5 = folder["Rose #5"]:Clone()
local sadPoster = folder["sad poster"]:Clone()
local knife = game.Workspace.Knife
function makeSureEverytingLooksGood(model)
for i, child in ipairs(model:GetChildren()) do
if child:IsA("Part") then
if child.Transparency ~= 0 then
child.Transparency = 0
child.CanCollide = true
for j, grandChild in ipairs(child:GetChildren()) do
if grandChild:IsA("Decal") then
grandChild.Transparency = 0
elseif grandChild:IsA("SurfaceGui") then
grandChild.Enabled = true
end
end
end
end
end
end
function step1(island)
for i, child in ipairs(knife:GetChildren()) do
if child:IsA("Part") then
child.Touched:Connect(function(hit)
island.Parent = game.Workspace
end)
end
end
end
function step2(object,island)
object.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
island.Parent = game.Workspace
for i, part in ipairs(island:GetChildren()) do
if part:IsA("Part") then
part.Transparency = 0
part.CanCollide = true
for j, grandChild in ipairs(part:GetChildren()) do
if grandChild:IsA("Decal") then
grandChild.Transparency = 0
elseif grandChild:IsA("SurfaceGui") then
grandChild.Enabled = true
end
end
end
end
end
end)
end
function rose1(object,island)
object.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
rose2.Parent = game.Workspace
for i, part in ipairs(island.Parent:GetChildren()) do
if part:IsA("Part")then
part.Transparency = 0
part.CanCollide = true
for j, grandChild in ipairs(part:GetChildren()) do
if grandChild:IsA("Decal") then
grandChild.Transparency = 0
elseif grandChild:IsA("SurfaceGui") then
grandChild.Enabled = true
end
end
end
end
end
end)
end
function rose2(object,island)
object.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
rose3.Parent = game.Workspace
for i, part in ipairs(island.Parent:GetChildren()) do
if part:IsA("Part")then
part.Transparency = 0
part.CanCollide = true
for j, grandChild in ipairs(part:GetChildren()) do
if grandChild:IsA("Decal") then
grandChild.Transparency = 0
elseif grandChild:IsA("SurfaceGui") then
grandChild.Enabled = true
end
end
end
end
end
end)
end
function rose3(object,island)
object.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
rose4.Parent = game.Workspace
for i, part in ipairs(island.Parent:GetChildren()) do
if part:IsA("Part")then
part.Transparency = 0
part.CanCollide = true
for j, grandChild in ipairs(part:GetChildren()) do
if grandChild:IsA("Decal") then
grandChild.Transparency = 0
elseif grandChild:IsA("SurfaceGui") then
grandChild.Enabled = true
end
end
end
end
end
end)
end
function rose4(object,island)
object.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
rose5.Parent = game.Workspace
print("Test")
for i, part in ipairs(island.Parent:GetChildren()) do
if part:IsA("Part")then
part.Transparency = 0
part.CanCollide = true
for j, grandChild in ipairs(part:GetChildren()) do
if grandChild:IsA("Decal") then
grandChild.Transparency = 0
elseif grandChild:IsA("SurfaceGui") then
grandChild.Enabled = true
end
end
end
end
end
end)
end
makeSureEverytingLooksGood(island1)
makeSureEverytingLooksGood(island2)
makeSureEverytingLooksGood(island3)
makeSureEverytingLooksGood(island4)
makeSureEverytingLooksGood(rose2)
makeSureEverytingLooksGood(rose3)
makeSureEverytingLooksGood(rose4)
makeSureEverytingLooksGood(rose5)
makeSureEverytingLooksGood(sadPoster)
step1(island1)
step2(island1.Poster,island2)
step2(island2.Orb,sadPoster)
step2(sadPoster.Part,island3)
rose1(island3["Rose #1"].Stem,rose2.Stem)
rose2(rose2.Stem,rose3.Stem)
rose3(rose3.Stem,rose4.Stem)
rose4(rose4.Stem,rose5.Stem)
Condenced Script with problem
local rose2 = folder["Rose #2"]:Clone()
function makeSureEverytingLooksGood(model)
for i, child in ipairs(model:GetChildren()) do
if child:IsA("Part") then
if child.Transparency ~= 0 then
child.Transparency = 0
child.CanCollide = true
for j, grandChild in ipairs(child:GetChildren()) do
if grandChild:IsA("Decal") then
grandChild.Transparency = 0
elseif grandChild:IsA("SurfaceGui") then
grandChild.Enabled = true
end
end
end
end
end
end
makeSureEverytingLooksGood(rose2)
Why is this error happening: Workspace.Script:14: attempt to index function with ‘GetChildren’