Grow neck script

hello, I’m making a script that able to make player grow neck (controllable)

This is my current script: its working but not what I expected, is there a better solution?

local character = player.Character or player.CharacterAdded:Wait()
local neck = character:FindFirstChild("Neck") 
local head = character:FindFirstChild("Head") 

if not neck or not head then
	warn("Neck or Head not found in the giraffe model.")
	return
end

local growthDirection = Vector3.new(0, 1, 0) 
local growthRate = 0.5
local maxGrowth = 5 

function growNeck()
	
	local currentNeckCount = 0
	for _, part in pairs(character:GetChildren()) do
		if part.Name == "Neck" then
			currentNeckCount = currentNeckCount + 1
		end
	end

	if currentNeckCount < maxGrowth then
		local newNeck = neck:Clone() 
		newNeck.Parent = character 
		newNeck.Position = neck.Position + growthDirection * (neck.Size.Y * currentNeckCount)
		head.Position = newNeck.Position + Vector3.new(0, newNeck.Size.Y / 2 + 1, 0)
	else
		print("Maximum neck growth reached.")
	end
end

function growHorizon()
	local currentNeckCount = 0
	for _, part in pairs(character:GetChildren()) do
		if part.Name == "Neck" then
			currentNeckCount = currentNeckCount + 1
		end
	end

	if currentNeckCount < maxGrowth then
		local newNeck = neck:Clone() 
		newNeck.Parent = character 
		newNeck.Position = neck.Position + Vector3.new(1, 0, 0) * (neck.Size.X * currentNeckCount)
		head.Position = newNeck.Position + Vector3.new( newNeck.Size.X / 2+1, 0, 0)
	else
		print("Maximum neck growth reached.")
	end
end




game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
	if not gameProcessed then
		if input.KeyCode == Enum.KeyCode.F then
			growNeck()
		end
		if input.KeyCode == Enum.KeyCode.R then
			growHorizon()
		end


	end
end)```

I try to add attchment to Neck part for better solution, but nope not work again

if your script is having problems, move this to #help-and-feedback:scripting-support and provide an example of what you want, and a video or image of what’s going wrong.

1 Like

robloxapp-20241102-0318116.wmv (137.8 KB)
there is more progress than that but I just decide to redo everything again (basically I can increase my neck vertical/horizontal?) but I see that this script isn’t effective, if I can have advice for better solution than this one, please.

what I image what it look like

or maybe I should try another one, if I can find another solution I will tick this as solved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.