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

Would a Cutter brick work?

script.Parent.Touched:connect(function(hit)
		if hit.Planks and hit.Name == "Log" then
			print("lol")
			planks = hit.Planks.Value
		for i = 1, planks do
			print("lol")
			part = Instance.new("Part")
			part.Position = hit.Postion.Vector3.new()
			print("lol")
		end
	end
end)

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.

1 comment

0

print("lol") is just to bug test.

2 answers

✓ Accepted answer

For the color just do:

part.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.

Hi, You can just say

part.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.

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