Having trouble setting Vector3Value to object

Hello everyone, I’m currently workin on a nuke system where if you press a buttonUI it clones an object and assigns its position to a Vector3Value.
Everything seems working fine since I get no errors and script runs normally but it wont assign position, any suggestion or knowledge to why this may happen?

function OnClick()
	script.Parent.Parent.Parent.Enabled = false
	
	local part = game:GetService("ReplicatedStorage").nukes.Nuke:clone()
	part.Parent = game.Workspace
	part.Position = script.Parent.Parent.Parent.Coordenate.Value -- sets nuke position
	wait(3)
	local exp = game:GetService("ReplicatedStorage").nukes.Explosion:Clone()
	local exp2 = Instance.new("Explosion")
	local sound = part.NukeSound

	exp.Parent = part
	exp.Position = script.Parent.Parent.Parent.BombCoordenate.Value
	sound:Play()

	exp2.Parent = exp
	exp2.Position = script.Parent.Parent.Parent.BombCoordenate.Value
	exp2.BlastPressure = 7000
	exp2.BlastRadius = 100
	exp2.DestroyJointRadiusPercent = 1	
end

script.Parent.MouseButton1Click:Connect(OnClick)

I’ve tried many forms, still don’t find a reason or solution.

Maybe the reason is that your part is anchored ?

1 Like

I also checked this and that wasn’t the reason, it shows out the script that changed the Vector3Value value was a LocalScript that’s why it didn’t change position, mb haha! :sweat_smile: