script.Parent.Touched:connect(function(hit)
if hit.Planks and hit.Name == "Log" then
planks = hit.Planks.Value
for i = 1, tonumber(planks) do
part = Instance.new("Part")
part.Position = Vector3.new(hit.Position)
part.Size = Vector3.new(1, 9.6, 0.2)
hit:Remove()
end
end
end)
I'm clueless one why it won't work.
Planks is an intvalue in Log

4 comments
Whats the output??
new is not a valid member. Line 8
And also. Even when I Remove the invalid line #8. It should work with out it but it doesn't even create the parts. Should I use tonumber()?
edited script above