Last active
August 5, 2023 12:17
-
-
Save FirstVertex/b5182d3a05778b521498de611074e582 to your computer and use it in GitHub Desktop.
Roblox lua Grow-n-Shrink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- line 1 | |
local heightValue = game.ReplicatedStorage.HeightValue | |
-- line 18 | |
heightValue.Value = HD.HeightScale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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