Hello developers! I need help with something and I hope some of you can be of assistance. How would I be able to make a tool that shrinks you on use? Once you activate the tool? Your character is shrunk to, lets say, a quarter of its size. How would I do that? Let me know down in the replies. Thank you!
1 Like
Tool.Activated:Connect(function()
local NumberValue = Instance.new("NumberValue")
NumberValue.Value = 1
local Tween = game:GetService("TweenService"):Create(NumberValue, TweenInfo.new(1), {Value = 0.5}) -- It'll take a second to shrink the character to half size.
Tween:Play()
local NumberConnection = NumberValue.Changed:Connect(function(Value)
Character:ScaleTo(Value)
end)
Tween.Completed:Wait()
NumberConnection:Disconnect()
NumberConnection = nil
NumberValue:Destroy()
NumberValue = nil
Tween = nil
end)
1 Like
Ai generations
local tool = script.Parent
local debounce = false
local function shrinkCharacter()
if debounce then
return
end
debounce = true
local player = tool.Parent.Parent
local character = player.Character
if not character then
return
end
local scale = character:GetAttribute("OriginalScale") or character.HumanoidRootPart.Size
character.HumanoidRootPart.Size = scale * 0.25
character:SetAttribute("OriginalScale", scale)
wait(5)
character.HumanoidRootPart.Size = scale
debounce = false
end
tool.Equipped:Connect(shrinkCharacter)
You can follow.
Thank you! Just one problem however, the speed slows down on shrinking. How would I fix that?
You can experiment with easing and directions.
for example
local Tween = game:GetService("TweenService"):Create(NumberValue, TweenInfo.new(1,Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {Value = 0.5}) -- It'll take a second to shrink the character to half size.
1 Like
Speed of what? The character… that would be movement distance not speed though…
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.