local Player = game:GetService("Players").LocalPlayer
local Workspace = game:GetService("Workspace")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Character = Player.Character or Player.CharacterAdded:Wait()
local HRP = Character:WaitForChild("HumanoidRootPart")
local Chests = ReplicatedStorage:WaitForChild("ChestsModels")
for _, v in pairs(Workspace:GetDescendants()) do
if Chests:FindFirstChild(v.Name) then
local ChestParts
if v:IsA("MeshPart") or v:IsA("UnionOperation") then
ChestParts = v
elseif v:IsA("Model") then
ChestParts = v.PrimaryPart
end
if chestPart then
HRP.CFrame = ChestParts.CFrame + Vector3.new(0, 5, 0)
end
end
end
Comments
No comments yet
Be the first to share your thoughts!