Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Prioxis 673 Moderation Voter
9 years ago

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

Log in to vote
1
Answered by 9 years ago

To add two vectors:

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

print(vec1 + vec2) --> (1, 1, 1)
Ad
Log in to vote
1
Answered by
JSpade 5
9 years ago

I think you may to try something like:

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

Answer this question