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
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)