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

Why does the +vector3.new/-Vector3.new not work?

Asked by 10 years ago
local enabled = true
Player = script.Parent.Parent
character = Player.CharacterAdded:wait();
mouse = Player:GetMouse()
Run = game:GetService("RunService")
Head = Player.Character.Head 
function onKeyDown(key)
    key = key:lower()
    if key == "r" then
        game:GetService("Chat"):Chat(Player.Character.Head, "REN!")
        r = Instance.new("Part")
        r.Shape = "Ball"
        r.Transparency = 0.7
        r.BrickColor = BrickColor.new("White")
        r.TopSurface = "Smooth"
        r.BottomSurface = "Smooth"
        r.CanCollide = false
        for i = 1,20 do
        r.Size = Vector3.new(r.Size.X + 1, r.Size.Y + 1, r.Size.Z + 1)
        wait()
    end
        for i = 1,20 do
        r.Size = Vector3.new(r.Size.X - 1, r.Size.Y - 1, r.Size.Z - 1)
    end
        r.Parent = workspace
        Weld = Instance.new("Weld")
        Weld.Part0 = r
        --Weld.C0 = r.CFrame:inverse
        Weld.Part1 = Head
        Weld.Parent = character 
    end
end

mouse.KeyDown:connect(onKeyDown)

Thanks for helping me.

0
Is there an error? BlueTaslem 18071 — 10y
0
No. kingalpha1 15 — 10y
0
Actually yes,Head is not a valid member of Model kingalpha1 15 — 10y
0
its not that - and + dosen't work, it's the fact that's head isn't part of the model NinjoOnline 1146 — 10y
1
I gave this guy this method and he downvoted it! WTF?! bobafett3544 198 — 10y

1 answer

Log in to vote
1
Answered by
Cr0ws 20
10 years ago

Try:

 char = Workspace:findFirstChild(Player.Name)
Head= char:findFirstChild("Head")
0
It would probably be better to use WaitForChild() because we know the head will exist eventually, but the FindFirstChild will return nil if it doesn't exist at that particular time. Perci1 4988 — 10y
Ad

Answer this question