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
If you have any question ask them!
Can you help me guys?