Hello. I was wondering how I would be able to make a part have a "float" animation while being welded to a character. Here is how the summon looks like: https://gyazo.com/46dbb636e65fe6bf157f7dc6237e841e
I currently have this set up as a remote function, with a local and server script.
Here is the server script:
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()
print("True Input sent")
elseif value == false then
book.Parent = game.ServerStorage
print("False input sent")
end
end)
Here is the local script:
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
)
