Skip to content

Instantly share code, notes, and snippets.

@FirstVertex
Last active August 5, 2023 12:17
Show Gist options
  • Save FirstVertex/b5182d3a05778b521498de611074e582 to your computer and use it in GitHub Desktop.
Save FirstVertex/b5182d3a05778b521498de611074e582 to your computer and use it in GitHub Desktop.
Roblox lua Grow-n-Shrink
local debounceTime = 3
local canTouch = true
script.Parent.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid and canTouch then
canTouch = false
local HD = Humanoid:GetAppliedDescription()
HD.HeadScale = HD.HeadScale * 2
HD.DepthScale = HD.DepthScale * 2
HD.WidthScale = HD.WidthScale * 2
HD.HeightScale = HD.HeightScale * 2
Humanoid.JumpPower *= 1.1
Humanoid.WalkSpeed *= 1.5
Humanoid:ApplyDescription(HD)
local oldColor = script.Parent.BrickColor
script.Parent.BrickColor = BrickColor.Gray()
wait(debounceTime)
script.Parent.BrickColor = oldColor
canTouch = true
end
end)
local heightValue = game.ReplicatedStorage.HeightValue;
local textLabel = script.Parent
local function updateText()
textLabel.Text = 'Height: ' .. string.format("%.2f", heightValue.Value)
end
heightValue.Changed:Connect(updateText)
updateText()
-- line 1
local heightValue = game.ReplicatedStorage.HeightValue
-- line 18
heightValue.Value = HD.HeightScale
local heightValue = game.ReplicatedStorage.HeightValue;
local debounceTime = 3
local canTouch = true
script.Parent.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid and canTouch then
canTouch = false
local HD = Humanoid:GetAppliedDescription()
HD.HeadScale = HD.HeadScale * 0.5
HD.DepthScale = HD.DepthScale * 0.5
HD.WidthScale = HD.WidthScale * 0.5
HD.HeightScale = HD.HeightScale * 0.5
Humanoid.JumpPower *= 0.9
Humanoid.WalkSpeed *= 0.9
Humanoid:ApplyDescription(HD)
heightValue.Value = HD.HeightScale;
local oldColor = script.Parent.BrickColor;
script.Parent.BrickColor = BrickColor.Gray()
wait(debounceTime)
script.Parent.BrickColor = oldColor
canTouch = true
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment