Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local RunService = game:GetService("RunService")
- local character = script.Parent
- local standModel = ReplicatedStorage:WaitForChild("Stand")
- local standOffset = CFrame.new(3, 1, 3)
- local bodyPosTemplate = Instance.new("BodyPosition")
- bodyPosTemplate.D = 450
- bodyPosTemplate.MaxForce = Vector3.new(5000, 5000, 5000)
- bodyPosTemplate.P = 2000
- local bodyGyroTemplate = Instance.new("BodyGyro")
- bodyGyroTemplate.MaxTorque = Vector3.new(10000, 10000, 10000)
- bodyGyroTemplate.D = 150
- bodyGyroTemplate.P = 4000
- local newStand = standModel:Clone()
- local standPrimary = newStand.PrimaryPart
- local characterPrimary = character.PrimaryPart
- local characterHumanoid = character.Humanoid
- local newBodyPos = bodyPosTemplate:Clone()
- local newGyro = bodyGyroTemplate:Clone()
- newGyro.Parent = standPrimary
- newBodyPos.Parent = standPrimary
- newStand.Parent = workspace
- local function updateForces()
- local charCF = characterPrimary.CFrame
- newGyro.CFrame = charCF
- newBodyPos.Position = (charCF * standOffset).Position
- end
- while true do
- updateForces()
- RunService.RenderStepped:Wait()
- -- renderstepped really fast, using it prevents movement lag
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement