Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local newPart = Instance.new("Part")
- newPart.Anchored = true -- To prevent it from falling down
- -- Function to update the part's position
- local function updatePartPosition()
- local localPlayer = game.Players.LocalPlayer
- if localPlayer then
- local character = localPlayer.Character
- if character and character:FindFirstChild("HumanoidRootPart") then
- local newPosition = character.HumanoidRootPart.Position
- newPart.Position = Vector3.new(newPosition.X, 0, newPosition.Z)
- end
- end
- end
- -- Connect the updatePartPosition function to the heartbeat of the RunService
- runService.Heartbeat:Connect(updatePartPosition)
- -- Parent the new part to the workspace (you can change the parent as needed)
- newPart.Parent = game.Workspace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement