Hello. I am trying to make a game in my group where people have long legs but the rest of their body is normal. When I spawn in the script works and it looks like I want it to, but when I reset or die everything in the first script doesn’t work for some reason and my whole body is long instead of just the legs. I have tried to create a second debounce with died, had it check if a body part was the correct size, and more, but nothing worked. I was hoping if someone could help me find out how to make it work after you die or reset.
This is the first script that changes the location and size of everything but the legs so everything is the right size and position. It works when I spawn in, but not when I reset or die.
local button = script.Parent
local isTouched = false
local died = true
button.Touched:Connect(function(hit)
humanoid = hit.Parent:FindFirstChildWhichIsA('Humanoid')
if humanoid then
if isTouched == false or died == false then
local body = hit.Parent
humanoid.WalkSpeed = humanoid.WalkSpeed*2
humanoid.JumpHeight = humanoid.JumpHeight*2
body.LowerTorso.Size = body.LowerTorso.OriginalSize.Value
body.LeftFoot.Size = body.LeftFoot.OriginalSize.Value
body.LeftHand.Size = body.LeftHand.OriginalSize.Value
body.LeftLowerArm.Size = body.LeftLowerArm.OriginalSize.Value
body.LeftUpperArm.Size = body.LeftUpperArm.OriginalSize.Value
body.RightFoot.Size = body.RightFoot.OriginalSize.Value
body.RightHand.Size = body.RightHand.OriginalSize.Value
body.RightLowerArm.Size = body.RightLowerArm.OriginalSize.Value
body.RightUpperArm.Size = body.RightUpperArm.OriginalSize.Value
body.UpperTorso.Size = body.UpperTorso.OriginalSize.Value
body.Head.Size = body.Head.OriginalSize.Value
body.HumanoidRootPart.Size = body.HumanoidRootPart.OriginalSize.Value
body.UpperTorso.Position = body.UpperTorso.Position + Vector3.new(0, -4.5, 0)
body.Head.Position = body.Head.Position + Vector3.new(0, -8, .5)
body.LeftUpperArm.Position = body.LeftUpperArm.Position + Vector3.new(-.1, -.7, 0)
body.LeftLowerArm.Position = body.LeftLowerArm.Position + Vector3.new(0, 1.8, -.2)
body.LeftHand.Position = body.LeftHand.Position + Vector3.new(0, 4.5, -.2)
body.RightUpperArm.Position = body.RightUpperArm.Position + Vector3.new(-.1, -5.2, -.6)
body.RightLowerArm.Position = body.RightLowerArm.Position + Vector3.new(0, -2.7, .7)
body.RightHand.Position = body.RightHand.Position + Vector3.new(0, 0, .7)
body.HumanoidRootPart.Position = body.HumanoidRootPart.Position + Vector3.new(0, -4.5, 0)
body.Animate.ScaleDampeningPercent.Value = 2.5
humanoid.HipHeight = 10
isTouched = true
died = true
end
end
end)
if humanoid then
if humanoid.Health == 0 then
died = false
end
end
This is also a script that is in StarterCharacterScripts in StarterPlayer. This script works fine even if I die and elongates the whole body.
local humanoid = script.Parent.Humanoid
local person = script.Parent
humanoid.BodyHeightScale.Value = humanoid.BodyHeightScale.Value*6
There is no error code that pops up in the output or in the script even though it does not work. Here are some pictures to help you with what the right character should look like.
What I want it to look like:
Correct Character - Roblox Studio (gyazo.com)
What it looks like after the reset:
Wrong Character - Roblox Studio (gyazo.com)