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

Why doesn't my ball inflate then deflate?

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)

2 comments

0

Seems that no one knows how to fix it u.u.

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

1 answer

✓ Accepted answer

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

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