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

My Grid Isnt Working It Keeps Spliting Up?

Asked by 2 years ago

For Some Reason I Cant Get CFrame To Work I Dont Know Why. Im Trying To Make A Grid With CFrame So It Goes With Rotation But Its Not Working Insert A Part Then Put This Script In

Res = 40
OR = Vector2.new(Res,Res)
Ratio = OR.X * OR.Y
X = 0
Y = 0
Radius = 0.05
for i = 1,Ratio do

    local Part = Instance.new("Part")
    local P = script.Parent
    Sizee = Vector3.new(P.Size.X/OR.X,P.Size.Y/OR.Y,Radius)
    Part.Size = Sizee
    Part.Parent = P
    Part.CFrame = P.CFrame
    Part.CFrame *= CFrame.new(P.Size.X/2,P.Size.Y/2,P.Size.Z/2)
    Part.CFrame *= CFrame.new((X/(Part.Size.X*4))/P.Size.X,(Y/(Part.Size.Y*4))/P.Size.Y,0)
    Part.Anchored = true
    Instance.new("Attachment").Parent = Part
    Part["Attachment"].Name = "Start"
    Instance.new("Attachment").Parent = Part
    Part["Attachment"].Name = "End"
    Instance.new("Beam").Parent = Part
    Part["Beam"].Texture = "rbxassetid://2023453720"
    Part["Beam"].Attachment0 = Part["Start"]
    Part["Beam"].Attachment1 = Part["End"]
    Part["End"].Position = Vector3.new(0,0,-15)
    Part["Beam"].FaceCamera = true
    Part["Beam"].Transparency = NumberSequence.new(0.99)
    X = X + 1
    if X == OR.X then
        X = 0
        Y = Y + 1
    end
end

See Its not Working Can Somebody Tell Me What I Did Wrong?

0
It Splits More Or Less If I Change The Res nathanjohns123 20 — 2y

Answer this question