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

Help with In Pairs?

Asked by 8 years ago
Blocks={"Emerald","Ruby","Sapphire","Diamond","Coal","Coal","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt"}

function Mako()
for _, Part in pairs(script.Parent:GetChildren()) do
     if script.Parent.Parent.Generate.BrickColor ~= "Really red" then
    local Rocky = game.Lighting:FindFirstChild(Blocks[math.random(1,#Blocks)])
    local Mine = Rocky:Clone()
        Mine.Position = script.Parent.Part.Position
        Mine.Parent = script.Parent.Parent.Field
    else
        print("Cooling Down, Please wait")
    end
    end
end

script.Parent.Parent.Generate.ClickDetector.MouseClick:connect(Mako)

This script is supposed to act like the quarry script, except you regen the mine by pressing the button Generate, but instead when you press it, it puts a bunch of clones from lighting into one parts position

1 answer

Log in to vote
0
Answered by 8 years ago

at line 9 I used script.Parent.Part instead of Part

Ad

Answer this question