when i teleport the part, it doesn’t face the way i want it to
also, how would i weld it so it stays where i want it to but still moves with the player?
local script
local player = game.Players.LocalPlayer
local book = game.Workspace.KieranBook
local event = game.ReplicatedStorage.KieranBookEvent
player.Chatted:Connect(function(msg)
if string.find(msg:lower(), "summon book") then
event:FireServer()
end
end)
server script
local event = game.ReplicatedStorage.KieranBookEvent
local book = game.Workspace.KieranBook
event.OnServerEvent:Connect(function(player)
book.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(0, 100000, 0)
end)
local book = -- [[your book model here]]
local function summonBook(player)
local character = player.Character
if character and character:FindFirstChild("HumanoidRootPart") then
local summonedBook = book:Clone()
local weld = Instance.new("Weld")
weld.Part0 = summonedBook
weld.Part1 = character.HumanoidRootPart
weld.C0 = CFrame.new(0, 0, -5) * CFrame.Angles(0, 0, math.deg(30))
weld.Parent = book
book.Parent = character
end
end
now you may have to tweak some values around a bit until it works correctly (like C0 might need to be C1 instead, or Part0 may need to be swapped with Part1 instead).
you’ll also need to make sure the book isn’t anchored and that it’s massless. It’d also be a good idea to turn off collision for it.
i just used a weld constraint instead of a regular weld
local book = game.Workspace.KieranBook -- [[your book model here]]
game.ReplicatedStorage.KieranBookEvent.OnServerEvent:Connect(function(player)
local character = player.Character
if character and character:FindFirstChild("HumanoidRootPart") then
local summonedBook = book:Clone()
summonedBook.CFrame = character.UpperTorso.CFrame * CFrame.new(0,0,-2)
local weld = Instance.new("WeldConstraint")
weld.Part0 = summonedBook
weld.Part1 = character.UpperTorso
weld.Parent = summonedBook
summonedBook.Orientation = book.Orientation
summonedBook.Parent = character
summonedBook.Anchored = false
end
end)