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

Would a Cutter brick work?

Asked by 11 years ago
01script.Parent.Touched:connect(function(hit)
02        if hit.Planks and hit.Name == "Log" then
03            print("lol")
04            planks = hit.Planks.Value
05        for i = 1, planks do
06            print("lol")
07            part = Instance.new("Part")
08            part.Position = hit.Postion.Vector3.new()
09            print("lol")
10        end
11    end
12end)

Im trying to write a script that when a Log touches the brick it cuts up into the amount specified by a intvalue in the Log named planks. Also. I cannot figure out how to make the brickcolor of the new part the same as the log.

0
print("lol") is just to bug test. YellowoTide 1992 — 11y

2 answers

Log in to vote
1
Answered by
bobder2 135
11 years ago

For the color just do:

1part.BrickColor = hit.BrickColor

Make sure you set everything for the planks before you :Destroy() the log though, that way it's still there to copy the properties.

Ad
Log in to vote
0
Answered by
Rukiryo 25
11 years ago

Hi, You can just say

1part.Position = hit.Position

The position of the part you hit is ALREADY a Vector3. You only need to say Vector3.new when you are creating a new vector3.

Answer this question