When someone presses z, they go into a giant form. I want to make it so if someone presses z again, they return to their original form. This is my code so far. I put Player.Character.Humanoid.BodyDepthScale.Value = Player.Character.Humanoid.BodyDepthScale.Value + 1 Player.Character.Humanoid.BodyHeightScale.Value = Player.Character.Humanoid.BodyHeightScale.Value + 1 Player.Character.Humanoid.BodyWidthScale.Value = Player.Character.Humanoid.BodyWidthScale.Value + 1 Player.Character.Humanoid.HeadScale.Value = Player.Character.Humanoid.HeadScale.Value + 1 a bunch of times because I want a smooth transition while they grow into a giant form.
local Player = game.Players.LocalPlayer
local char = Player.Character
local mouse = Player:GetMouse()
local cooldown = 0
local Humanoid = game.Players.LocalPlayer:FindFirstChild("Humanoid")
mouse.KeyDown:connect(function(k)
k = k:lower()
if k == "z" and cooldown == 0 then
cooldown = 1
Player.Character.Humanoid.BodyDepthScale.Value = Player.Character.Humanoid.BodyDepthScale.Value + 1
Player.Character.Humanoid.BodyHeightScale.Value = Player.Character.Humanoid.BodyHeightScale.Value + 1
Player.Character.Humanoid.BodyWidthScale.Value = Player.Character.Humanoid.BodyWidthScale.Value + 1
Player.Character.Humanoid.HeadScale.Value = Player.Character.Humanoid.HeadScale.Value + 1
wait()
Player.Character.Humanoid.BodyDepthScale.Value = Player.Character.Humanoid.BodyDepthScale.Value + 1
Player.Character.Humanoid.BodyHeightScale.Value = Player.Character.Humanoid.BodyHeightScale.Value + 1
Player.Character.Humanoid.BodyWidthScale.Value = Player.Character.Humanoid.BodyWidthScale.Value + 1
Player.Character.Humanoid.HeadScale.Value = Player.Character.Humanoid.HeadScale.Value + 1
wait()
Player.Character.Humanoid.BodyDepthScale.Value = Player.Character.Humanoid.BodyDepthScale.Value + 1
Player.Character.Humanoid.BodyHeightScale.Value = Player.Character.Humanoid.BodyHeightScale.Value + 1
Player.Character.Humanoid.BodyWidthScale.Value = Player.Character.Humanoid.BodyWidthScale.Value + 1
Player.Character.Humanoid.HeadScale.Value = Player.Character.Humanoid.HeadScale.Value + 1
wait()
Player.Character.Humanoid.BodyDepthScale.Value = Player.Character.Humanoid.BodyDepthScale.Value + 1
Player.Character.Humanoid.BodyHeightScale.Value = Player.Character.Humanoid.BodyHeightScale.Value + 1
Player.Character.Humanoid.BodyWidthScale.Value = Player.Character.Humanoid.BodyWidthScale.Value + 1
Player.Character.Humanoid.HeadScale.Value = Player.Character.Humanoid.HeadScale.Value + 1
end
end)

2 comments
User a bool variable (Something like IsAGiant) that would change when the player presses the key. You should also be using UserInputService for input and not the Mouse functions.
Thank you so much!!!!