Vector3 Position Issue?

What is wrong with the Vector3 clone position?

local model = script.Parent.Parent.Pins
local Pin = script.Parent.Parent.PinsRegen.Pins

function regenerate()
	script.Parent.SurfaceGui.TextLabel.Text = "RESPAWNING."
	wait(1)
	script.Parent.SurfaceGui.TextLabel.Text = "RESPAWNING.."
	wait(1)
	script.Parent.SurfaceGui.TextLabel.Text = "RESPAWNING..."
	wait(1)
	script.Parent.Parent.Pins:ClearAllChildren()
	print(script.Parent.Parent.PinPosition.Pins1.Position)
	local Pins1 = Pin:Clone()
	Pins1.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins1.Position)
	Pins1.Anchored = false
	Pins1.Parent = script.Parent.Parent.Pins
	local Pins2 = Pin:Clone()
	Pins2.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins2.Position)
	Pins2.Anchored = false
	Pins2.Parent = script.Parent.Parent.Pins
	local Pins3 = Pin:Clone()
	Pins3.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins3.Position)
	Pins3.Anchored = false
	Pins3.Parent = script.Parent.Parent.Pins
	local Pins4 = Pin:Clone()
	Pins4.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins4.Position)
	Pins4.Anchored = false
	Pins4.Parent = script.Parent.Parent.Pins
	local Pins5 = Pin:Clone()
	Pins5.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins5.Position)
	Pins5.Anchored = false
	Pins5.Parent = script.Parent.Parent.Pins
	local Pins6 = Pin:Clone()
	Pins6.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins6.Position)
	Pins6.Anchored = false
	Pins6.Parent = script.Parent.Parent.Pins
	local Pins7 = Pin:Clone()
	Pins7.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins7.Position)
	Pins7.Anchored = false
	Pins7.Parent = script.Parent.Parent.Pins	
	local Pins8 = Pin:Clone()
	Pins8.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins8.Position)
	Pins8.Anchored = false
	Pins8.Parent = script.Parent.Parent.Pins	
	local Pins9 = Pin:Clone()
	Pins9.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins9.Position)
	Pins9.Anchored = false
	Pins9.Parent = script.Parent.Parent.Pins
	local Pins10 = Pin:Clone()
	Pins10.Position = Vector3.new(script.Parent.Parent.PinPosition.Pins10.Position)
	Pins10.Anchored = false
	Pins10.Parent = script.Parent.Parent.Pins		
	script.Disabled = true
	script.Parent.SurfaceGui.TextLabel.Text = "Cooldown ends in 5..."
	wait(1)
	script.Parent.SurfaceGui.TextLabel.Text = "Cooldown ends in 4..."
	wait(1)
	script.Parent.SurfaceGui.TextLabel.Text = "Cooldown ends in 3..."
	wait(1)
	script.Parent.SurfaceGui.TextLabel.Text = "Cooldown ends in 2..."
	wait(1)
	script.Parent.SurfaceGui.TextLabel.Text = "Cooldown ends in 1..."
	wait(1)
	script.Parent.SurfaceGui.TextLabel.Text = "CLICK/TAP TO RESET PINS"
	script.Disabled = false
end

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	regenerate()
end)

Hello! When referencing an object’s position it already returns you a Vector3 value. So in the above line you are doing something like,

Pins1.Position = Vector3.new(Vector3.new(x, y, z))

which does not make any sense.

Try running this command instead, and apply it elsewhere necessary:

Pins1.Position = script.Parent.Parent.PinPosition.Pins1.Position
1 Like

Vector3.new has 3 number arguments and you are typing a Vector3. So try getting rid of the Vector3.new and just keeping the Vector

Pins3.Position = script.Parent.Parent.PinPosition.Pins3.Position
2 Likes