Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- // Find JD model inside the folder structure
- local buildingsFolder = workspace:WaitForChild("Buildings")
- local shopsFolder = buildingsFolder:WaitForChild("Shops")
- local jdModel = shopsFolder:WaitForChild("JD")
- -- // Look for the ClothingStand model inside JD
- local clothingStand = jdModel:FindFirstChild("ClothingStand")
- -- // Make sure ClothingStand is found
- if clothingStand then
- -- // Get the position of the ClothingStand (you can also adjust the position as needed)
- local clothingStandPosition = clothingStand.PrimaryPart.Position
- -- // Calculate a new position next to the ClothingStand (adjust as needed)
- local targetPosition = clothingStandPosition + Vector3.new(5, 0, 0) -- Offset to the right
- -- // Create a new part at the target position with a unique name
- local teleportPart = Instance.new("Part")
- teleportPart.Name = "JDTELEPORTPARTZERO" -- Unique name
- teleportPart.Size = Vector3.new(2, 1, 2) -- Set the size of the part
- teleportPart.Position = targetPosition -- Position it next to the ClothingStand
- teleportPart.Anchored = true -- Anchor the part to keep it in place
- teleportPart.CanCollide = false -- Disable collisions for the part
- teleportPart.Parent = workspace -- Parent it to the workspace
- -- // Optionally, give the part a transparent appearance (to avoid obstruction)
- teleportPart.Transparency = 0.5 -- Adjust transparency as needed
- -- // Get the player's character
- local player = game.Players.LocalPlayer
- local character = player.Character
- if character then
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- -- // Tween the character to the new part's position
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- -- // Set goal for tween (position of the teleport part)
- local goal = {Position = teleportPart.Position}
- local tween = tweenService:Create(humanoidRootPart, tweenInfo, goal)
- -- // Play the tween
- tween:Play()
- -- // Optional: Clean up the teleport part after some time (e.g., 5 seconds)
- game:GetService("Debris"):AddItem(teleportPart, 5)
- end
- else
- warn("ClothingStand model not found in JD!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement