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

how do you add to a value that requires a vector3.new()?

so I'm making a healing spell and its going to insert a part thats going to increase in size until it hits 5, 5, 5 then its going to be removed

heres my script :

Mouse.KeyDown:connect(function(key)
	if script.Wait.Value == false then
		if key == "h" then
			script.Wait.Value = true
			n.Enabled = true
			local m = Instance.new("Part")
			m.Parent = game.workspace
			local x = Instance.new("SpecialMesh", m)
			x.MeshId = "http://www.roblox.com/Asset/?id=9756362"
			m.Position = character.Torso.Position
			m.CanCollide = false
			m.BrickColor = BrickColor.new("Bright green")
			m.Anchored = true
			for i = 1, 12 do
				x.Scale = Vector3.new(1, 1, 1) = x.Scale = Vector3.new(1, 1, 1) -- area I need help
				
			end
			for i = 1, 12 do
				RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 0.26)
				RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 0)
				Run.Stepped:wait(0.01)
			end
				for i = 1, 12 do
				RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, -0.26)
				RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 0)
				Run.Stepped:wait(0.005)
				end
				character.Humanoid.Health = character.Humanoid.Health +25
				n.Enabled = false
				script.Wait.Value = true
				wait(5)
				script.Wait.Value = false
		end
	end
end)

2 answers

To add two vectors:

local vec1 = Vector3.new(1, 0, 1)
local vec2 = Vector3.new(0, 1, 0)

print(vec1 + vec2) --> (1, 1, 1)

I think you may to try something like:

for i = 1, 5 do 
	x.Scale = Vector3.new(i, i, i) 
end 

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