Tweening body parts for a spell

Hey guys!
I did spawn a magic book at the right side of the plr, and it creates a black orb surrending the plr (who cast the spell).
I tween the orb to go on the top of the book and I reduce the size in the tween.
I want the plr size to reduce with the orb and the plr to follow the orb…
Like if the plr is into the orb and the orb get smaller with the plr…
I don’t know how to explain it but I just want to tween the plr’s size.
Is it possible?
This is my script :

---- GetService ----
local rp = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local TweenService = game:GetService("TweenService")

---- Variables ----
local  TornadoE = rp:WaitForChild("Remotes"):WaitForChild("TornadoEvent")
local animations = script:WaitForChild("Animations")
local meshes = script:WaitForChild("Meshes")
local sounds = script:WaitForChild("Sounds")
local speed = 60
local damage = 30

TornadoE.OnServerEvent:Connect(function(plr, direction)
	local char = plr.Character
	local hum = char:FindFirstChild("Humanoid")
	local humRP = char:FindFirstChild("HumanoidRootPart")
	
	local DebFolder = Instance.new("Folder", workspace)
	DebFolder.Name = "DebrisFolder"
	Debris:AddItem(DebFolder, 10)
	
	local book = meshes:WaitForChild("Book"):Clone()
	book.CFrame = humRP.CFrame * CFrame.new(2,0.6,-4.5)
	book.Parent = DebFolder
	Debris:AddItem(book, 10)

	local bookSound = book:WaitForChild("BookSound")
	bookSound:Play()
	
	local plrWS = char:FindFirstChild("Humanoid").WalkSpeed
	char.Humanoid.WalkSpeed = 0
	local plrJP = char.Humanoid.JumpPower
	char.Humanoid.JumpPower = 0
	
	wait(1)
	
	local darkOrb = meshes:WaitForChild("DarkOrb"):Clone()
	darkOrb.CFrame = char.HumanoidRootPart.CFrame
	darkOrb.Parent = DebFolder
	
	local tweenInf = TweenInfo.new(
		2.5,
		Enum.EasingStyle.Quad,
		Enum.EasingDirection.Out,
		0,
		false
	)
	
	local properties = {
		Size = Vector3.new(1.5,1.5,1.5),
		Position = book.Position + Vector3.new(0,2,0)
	}
	
	local targets = {
		char.Humanoid.BodyDepthScale,
		char.Humanoid.BodyWidthScale,
		char.Humanoid.HeadScale
	}
	
	local Tween = TweenService:Create(darkOrb, tweenInf, properties)
	local Tween1 = TweenService:Create(book, tweenInf, {Orientation = book.Orientation + Vector3.new(-51.85, 0, 0)})
	local Tween2 = TweenService:Create(char.HumanoidRootPart, tweenInf, {Position = book.Position + Vector3.new(0,2,0)})
	local Tween3 = TweenService:Create(targets, tweenInf, {Value = 1.5})
	Tween:Play()
	Tween1:Play()
	Tween2:Play()
	Tween3:Play()
	
	TornadoE:FireClient(plr)
	wait(10)
	char:FindFirstChild("Humanoid").WalkSpeed = plrWS
	char:FindFirstChild("Humanoid").JumpPower = plrJP
end)

And this is the output error :

  23:47:54.941 - Unable to cast value to Object
23:47:54.941 - Stack Begin
23:47:54.942 - Script 'ServerScriptService.Magic: TornadoServer', Line 64
23:47:54.943 - Stack End

Mhhh this is the result when I remove the unworking part of the script:

So you can see the plr is flying on the top of the book in the forcefield black orb.
Now I just need to resize the plr’s size :confused:

If you have any question ask them!
Can you help me guys?

According to the error, you’re trying to Tween a Table, I would just get the objects and then cast it there

2 Likes

Mhh I can’t make a table with all the parts i want to tween, like for the properties you want to change? :confused:

So let me try to tween all of the body parts one by one

It worked thx you, but this is the size of my plr with 1.5 for each value.
Size
I think there is more than :

char.Humanoid.BodyDepthScale,
char.Humanoid.BodyWidthScale,
char.Humanoid.HeadScale

Do you know them?

Wait wtf xD

I look like a stickbug xD

Change it to 1 or 1.25, maybe that will kill the bug :wink:

1 Like

This is not the problem xD,
The problem is i don’t have the value of the plr’s tall

The players height? If that’s what you want it’s Humanoid.HipHeight

1 Like

Thx you I’ll try ! (30 characterss)

Mhh, I still have the same issue
This is my script (All work except the hipHeight

script :

---- GetService ----
local rp = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local TweenService = game:GetService("TweenService")

---- Variables ----
local  TornadoE = rp:WaitForChild("Remotes"):WaitForChild("TornadoEvent")
local animations = script:WaitForChild("Animations")
local meshes = script:WaitForChild("Meshes")
local sounds = script:WaitForChild("Sounds")
local speed = 60
local damage = 30

TornadoE.OnServerEvent:Connect(function(plr, direction)
	local char = plr.Character
	local hum = char:FindFirstChild("Humanoid")
	local humRP = char:FindFirstChild("HumanoidRootPart")
	
	local DebFolder = Instance.new("Folder", workspace)
	DebFolder.Name = "DebrisFolder"
	Debris:AddItem(DebFolder, 10)
	
	local book = meshes:WaitForChild("Book"):Clone()
	book.CFrame = humRP.CFrame * CFrame.new(2,0.6,-4.5)
	book.Parent = DebFolder
	Debris:AddItem(book, 10)

	local bookSound = book:WaitForChild("BookSound")
	bookSound:Play()
	
	local plrWS = char:FindFirstChild("Humanoid").WalkSpeed
	char.Humanoid.WalkSpeed = 0
	local plrJP = char.Humanoid.JumpPower
	char.Humanoid.JumpPower = 0
	
	wait(1)
	
	local darkOrb = meshes:WaitForChild("DarkOrb"):Clone()
	darkOrb.CFrame = char.HumanoidRootPart.CFrame
	darkOrb.Parent = DebFolder
	
	local tweenInf = TweenInfo.new(
		2.5,
		Enum.EasingStyle.Quad,
		Enum.EasingDirection.Out,
		0,
		false
	)
	
	local properties = {
		Size = Vector3.new(1.5,1.5,1.5),
		Position = book.Position + Vector3.new(0,2,0)
	}
	
	local targets = {
		char.Humanoid.BodyDepthScale,
		char.Humanoid.BodyWidthScale,
		char.Humanoid.HeadScale,
		char.Humanoid.HipHeight
	}
	
	local Tween = TweenService:Create(darkOrb, tweenInf, properties)
	local Tween1 = TweenService:Create(book, tweenInf, {Orientation = book.Orientation + Vector3.new(-51.85, 0, 0)})
	local Tween2 = TweenService:Create(char.HumanoidRootPart, tweenInf, {Position = book.Position + Vector3.new(0,2,0)})
	local Tween3 = TweenService:Create(targets[1], tweenInf, {Value = 0.15})
	local Tween4 = TweenService:Create(targets[2], tweenInf, {Value = 0.15})
	local Tween5 = TweenService:Create(targets[3], tweenInf, {Value = 0.15})
	local Tween6 = TweenService:Create(targets[4], tweenInf, {Value = 0.15})
	Tween:Play()
	Tween1:Play()
	Tween2:Play()
	Tween3:Play()
	Tween4:Play()
	Tween5:Play()
	Tween6:Play()
	
	TornadoE:FireClient(plr)
	wait(10)
	char:FindFirstChild("Humanoid").WalkSpeed = plrWS
	char:FindFirstChild("Humanoid").JumpPower = plrJP
end)

It works ! Thx for your help! See ya !!!