o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
Generate an advanced roblox script where the player grows bigger every 1.5 tick.
- User
Generate an advanced roblox script where the player grows bigger every 1.5 tick.
- Assistant
Generate an advanced roblox script where the player grows bigger every 1.5 tick.
-- Advanced Roblox script to make the player's character grow bigger every 1.5 seconds with smooth transitions and error handling
-- Services
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
-- Scaling parameters
local scaleIncrement = 0.1 -- Amount to increase scale each time
local scalingTime = 1.5 -- Time between growths in seconds
-- Function to grow the character
local function growCharacter(character)
if not character or not character.Parent then return end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end
if humanoid.RigType == Enum.HumanoidRigType.R15 then
-- For R15 characters, adjust BodyScale values with Tweening
local bodyHeightScale = humanoid:FindFirstChild("BodyHeightScale")
local bodyWidthScale = humanoid:FindFirstChild("BodyWidthScale")
local bodyDepthScale = humanoid:FindFirstChild("BodyDepthScale")
local headScale = humanoid:FindFirstChild("HeadScale")
if bodyHeightScale and bodyWidthScale and bodyDepthScale and headScale then
local tweenInfo = TweenInfo.new(scalingTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local heightGoal = {Value = bodyHeightScale.Value + scaleIncrement}
local widthGoal = {Value = bodyWidthScale.Value + scaleIncrement}
local depthGoal = {Value = bodyDepthScale.Value + scaleIncrement}
local headGoal = {Value = headScale.Value + scaleIncrement}
local heightTween = TweenService:Create(bodyHeightScale, tweenInfo, heightGoal)
local widthTween = TweenService:Create(bodyWidthScale, tweenInfo, widthGoal)
local depthTween = TweenService:Create(bodyDepthScale, tweenInfo, depthGoal)
local headTween = TweenService:Create(headScale, tweenInfo, headGoal)
heightTween:Play()
widthTween:Play()
depthTween:Play()
headTween:Play()
end
else
-- For R6 characters, scale parts directly with care
local originalSizes = {}
local tweens = {}
-- Store original sizes to maintain proportions
for _, part in pairs(character:GetChildren()) do
if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
originalSizes[part] = part.Size
end
end
-- Create tweens for each part
for part, originalSize in pairs(originalSizes) do
local tweenInfo = TweenInfo.new(scalingTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local newSize = originalSize + Vector3.new(scaleIncrement, scaleIncrement, scaleIncrement)
local sizeGoal = {Size = newSize}
local sizeTween = TweenService:Create(part, tweenInfo, sizeGoal)
table.insert(tweens, sizeTween)
end
-- Play all tweens
for _, tween in pairs(tweens) do
tween:Play()
end
-- Adjust joint positions after scaling
RunService.RenderStepped:Wait() -- Wait for the next frame to ensure sizes have updated
humanoid:BuildRigFromAttachments()
end
end
-- Function to start the growing process
local function startGrowing()
local character = player.Character or player.CharacterAdded:Wait()
-- Continuous loop to grow the character
while character and character.Parent do
growCharacter(character)
wait(scalingTime)
end
end
-- Connect to CharacterAdded event to start growing when the character spawns
player.CharacterAdded:Connect(function(character)
wait(1) -- Delay to ensure character is fully loaded
startGrowing()
end)
-- Start growing immediately if the character already exists
if player.Character then
wait(1) -- Delay to ensure character is fully loaded
startGrowing()
end
Explanation:
This advanced script makes the player’s character grow bigger every 1.5 seconds. It handles both R15 and R6 character rigs and uses smooth transitions via TweenService. Here's how it works:
Services and Variables:
Players, TweenService, and RunService.scaleIncrement and scalingTime.growCharacter Function:
BodyHeightScale, BodyWidthScale, BodyDepthScale, and HeadScale values.TweenService to smoothly increase each scale value by scaleIncrement over scalingTime seconds.humanoid:BuildRigFromAttachments() to adjust the joints and ensure the character stays intact.startGrowing Function:
growCharacter every scalingTime seconds.Event Connections:
CharacterAdded event to start the growth process whenever the character spawns.Notes:
Smooth Transitions:
TweenService, the growth appears smooth rather than an abrupt change, enhancing the visual effect.Error Handling:
Compatibility:
Joint Adjustment:
humanoid:BuildRigFromAttachments() to prevent the character from breaking apart due to size changes.Usage:
Disclaimer:
Not yet included in a published release.