Help with a script

local Main = script.Parent
local debounce = false

Main.Touched:Connect(function()
	local SetParent = game.Workspace
	local SetColor = Main.Color
	local SetTransparency = .5
	local SetMaterial = "Neon"
	local SetPosition = Main.Position
	local SetName = "Glow"
	if not debounce then debounce = true
		local NewPart = Instance.new("Part")
		NewPart.Parent = SetParent
		NewPart.Color = SetColor
		NewPart.Transparency = SetTransparency
		NewPart.Material = SetMaterial
		NewPart.Position = SetPosition
		NewPart.Name = SetName
		NewPart.CanCollide = false
		NewPart.Anchored = true
		wait(5)
		debounce = false
	end
end)

So on the line where it sets new parts position how to I make it so that it increases its position by one stud on the y axis while using the variable

1 Like

What you could do is plus+ it by the position to increase it one by one:

NewPart.Position = SetPosition + CFrame.new(0, SetPosition.Y, 0)

I think this would be the fix to what you want. Please inform me if anything doesn’t work, if it does help be sure to mark this as a solution :smiley:

1 Like
-- Vector3.new(X, Y, Z)
--[[ A value of 1 on the Y axis is what would need to be added
to that new position to achieve what you described --]]

NewPart.Position = SetPosition + Vector3.new(0, 1, 0)
1 Like