Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with In Pairs?

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.