Hello there.
I am currently working on a Black Clover game, in which people have a "floating" magical book in front of them. I have made the script to make it so the book appears after pressing a certain key, but I am having trouble making the floating book animated while it is summoned. I have tried lerping, which didn't work, as well as utilizing an animation. However, none have worked. How would I go about doing this? (The floating book is not a tool, but I would consider it an instance) Here is the code:
local summonevent = game ReplicatedStorage:WaitForChild("SummonGrimoire") wait(1) local book = game.ReplicatedStorage.books.Grimoire1 summonevent.OnServerEvent:Connect(function(player, value) if value == true then book:Clone() local Character = player.Character local root = Character:WaitForChild("HumanoidRootPart") local weld = Instance.new("Weld",root) weld.Part0 = root weld.C0 = CFrame.new(1.8,0,-3) * CFrame.Angles(math.rad(30),math.rad(0),math.rad(0)) book.Parent = root weld.Part1 = book local animation = Character.Humanoid:LoadAnimation(script.Idle) animation:Play() elseif value == false then book.Parent = game.ServerStorage end end)
^^^^This is a server script. Here is the Local Script for your convenience.
local summonevent = game.ReplicatedStorage:WaitForChild("SummonGrimoire") local UIS = game:GetService("UserInputService") local summoned = false UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.Q then if summoned == false then summonevent:FireServer(true) summoned = true elseif summoned == true then summonevent:FireServer(false) summoned = false end end end )