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

How do I input a script when the script create the part?

I want it to put a script in the block when it is created

local draw = function(target, source, color)
	local mag = (source - target).magnitude
	local Part = Instance.new("Part")
	Part.Anchored = true
	Part.CanCollide = false
	Part.Locked = true
	Part.TopSurface = Enum.SurfaceType.Smooth
	Part.BottomSurface = Enum.SurfaceType.Smooth
	Part.FormFactor = Enum.FormFactor.Custom
	Part.Size = Pallete.Size * Vector3.new(1, 1, mag)
	Part.CFrame = CFrame.new(source, target) *CFrame.new(0, 0, -mag/2)
	Part.Transparency = 1
	for i = 1, 6 do
		local SurfaceGui = Instance.new("SurfaceGui")
		SurfaceGui.Parent = Part
		SurfaceGui.Face = EnumFaces[i]
		local Frame = Instance.new("Frame")
		Frame.BackgroundColor3 = Pallete.Color
		Frame.BorderColor3 = Pallete.Color
		Frame.Size = UDim2.new(1, 0, 1, 0)
		Frame.Parent = SurfaceGui
	end

1 comment

0

Simply clone a script into the part my dude.

1 answer

✓ Accepted answer

like Goul said simply do

local c = script:Clone()--clones the script(btw if you are talking about the script you are editing right now you can use script to get it

c.Name = "faker"--changes name

c.Parent = game.Workspace.Part--inserts it into the part

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