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

Why doesn't my ball inflate then deflate?

Asked by 9 years ago
local enabled = true
Player = script.Parent.Parent
character = Player.CharacterAdded:wait();
mouse = Player:GetMouse()
Run = game:GetService("RunService")
Torso = Player.Character.Torso 
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
        r.Size = r.Size +Vector3.new(0.07, 0.07, 0.07)
        wait()
        r.Size = r.Size - Vector3.new (0.07, 0.07, 0.07)
        r.CFrame = Player.Character.Torso.CFrame *CFrame.new(0, 0, 0)
        r.Parent = workspace
        Weld = Instance.new("Weld")
        Weld.Part0 = r
        --Weld.C0 = r.CFrame:inverse
        Weld.Part1 = Torso
        Weld.Parent = character 
    end
end

mouse.KeyDown:connect(onKeyDown)
0
Seems that no one knows how to fix it u.u. kingalpha1 15 — 9y
0
Do you have any debugging to know that the waiting at the top actually finished? Instead of waiting for the event it might be better to just use a loop to wait for Player.Character BlueTaslem 18071 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago

Remove the r.Size variable after the equal signs in line 18 & 20 and you should be fine.

Ad

Answer this question