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

How to increase head size without player falling over?

I'm new to scripting with only a little bit of experience in python and this is my first time scripting in lua so I edited a deathblock script to increase headsize and this is what I got:

function onTouch(part) 
	local humanoid = part.Parent:FindFirstChild("Humanoid") 
	if (humanoid ~= nil) then
		humanoid.HeadScale.Value = humanoid.HeadScale.Value + 0.02
	end 
end

script.Parent.Touched:connect(onTouch)

The code itself works great but I have three other problems.

Once the head size gets to about 5, the player starts falling over and everything and I've tried to disable cancollide but that didn't do anything.

The code goes way too fast. I've tried adding wait variables to some of the parts in the code, but it seems to skip right past it. I did "wait(10)" in different spots, but of course it didn't seem to do anything.

The final thing is that I would like the item to be like a tool that you have in your inventory and when you click the script runs. Right now it's just a block that when you step on it the script runs

I'm pretty much a complete beginner in coding so if anyone can help me out thanks

1 answer

✓ Accepted answer

CanCollide only disables collisions, and not Mass, so Instead, I made It so the head has no mass

Here is the script

function onTouch(part)
	    local humanoid = part.Parent:FindFirstChild("Humanoid")
	    if (humanoid ~= nil) then
			local head = humanoid.Parent:FindFirstChild("Head")
			head.Massless = true
	        humanoid.HeadScale.Value = humanoid.HeadScale.Value + 0.02
	 end
end
	 
script.Parent.Touched:connect(onTouch)

6 comments

0

Thanks this worked great

0

Your welcome

0

Also, if it worked, check mark my answer

0

I would but I don't know how to be honest. All I see is a report button and an upvote button, but it says I need 25 reputation

0

you're good then, and if you need help with something else just tell me here.

0

I did it for you. You have to hover over the answer and there should be a button to accept the answer.

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