You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
A server script to increase the size of an NPC by 4x and then reduce it back to original size.
- What is the issue? Include screenshots / videos if possible!
The code works great on players in the game, but for NPC Models the enlarged model sinks halfway into the ground.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked through many posts. It appears there needs to be some adjustment to the position but I haven’t had any success moving the model’s cframe either before the tween - it ends up being a sequence where the model is moved upwards and then enlarged. I would like it to be a smooth enlargement with the NPC’s feet remaining on the ground.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
The code below is in a server script contained in the NPC model.
local char = script.Parent
local humanoid = char.Humanoid
local hrp = char.HumanoidRootPart
local TweenService = game:GetService("TweenService")
local humanoid = script.Parent.Humanoid -- replace 'NPC' with the name of your NPC model
local TweenService = game:GetService("TweenService")
TweenService:Create(humanoid.HeadScale, TweenInfo.new(1), {Value = 4}):Play()
TweenService:Create(humanoid.BodyDepthScale, TweenInfo.new(1), {Value = 4}):Play()
TweenService:Create(humanoid.BodyWidthScale, TweenInfo.new(1), {Value = 4}):Play()
TweenService:Create(humanoid.BodyHeightScale, TweenInfo.new(1), {Value = 4}):Play()
wait(5)
TweenService:Create(humanoid.HeadScale, TweenInfo.new(1), {Value = 1}):Play()
TweenService:Create(humanoid.BodyDepthScale, TweenInfo.new(1), {Value = 1}):Play()
TweenService:Create(humanoid.BodyWidthScale, TweenInfo.new(1), {Value = 1}):Play()
TweenService:Create(humanoid.BodyHeightScale, TweenInfo.new(1), {Value = 1}):Play()
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.