Advertisement
Smartdumgood

GirlFriendBlox

Jan 18th, 2025
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.57 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local TweenService = game:GetService("TweenService")
  4.  
  5. -- Animation States
  6. local currentAnim = "IDLE"
  7. local ANIMS = {
  8. IDLE = {
  9. leftArm = CFrame.new(-1.5, 0, 0),
  10. rightArm = CFrame.new(1.5, 0, 0),
  11. leftLeg = CFrame.new(-0.5, -2, 0),
  12. rightLeg = CFrame.new(0.5, -2, 0),
  13. head = CFrame.new(0, 1.5, 0)
  14. },
  15. SIT = {
  16. leftArm = CFrame.new(-1.5, 0, 0) * CFrame.Angles(0.2, 0, -0.1),
  17. rightArm = CFrame.new(1.5, 0, 0) * CFrame.Angles(0.2, 0, 0.1),
  18. leftLeg = CFrame.new(-0.5, -1.5, 0.5) * CFrame.Angles(math.rad(90), 0, 0),
  19. rightLeg = CFrame.new(0.5, -1.5, 0.5) * CFrame.Angles(math.rad(90), 0, 0),
  20. head = CFrame.new(0, 1.5, 0) * CFrame.Angles(-0.1, 0, 0)
  21. },
  22. DANCE = {
  23. leftArm = CFrame.new(-1.5, 0, 0) * CFrame.Angles(0, 0, math.rad(-45)),
  24. rightArm = CFrame.new(1.5, 0, 0) * CFrame.Angles(0, 0, math.rad(45)),
  25. leftLeg = CFrame.new(-0.5, -2, 0) * CFrame.Angles(0, 0, math.rad(-10)),
  26. rightLeg = CFrame.new(0.5, -2, 0) * CFrame.Angles(0, 0, math.rad(10)),
  27. head = CFrame.new(0, 1.5, 0) * CFrame.Angles(0, math.rad(30), 0)
  28. }
  29. }
  30.  
  31. local function createGUI()
  32. local screenGui = Instance.new("ScreenGui")
  33. local frame = Instance.new("Frame")
  34. frame.Size = UDim2.new(0, 150, 0, 200)
  35. frame.Position = UDim2.new(0.9, -150, 0.5, -100)
  36. frame.BackgroundColor3 = Color3.fromRGB(255, 192, 203)
  37.  
  38. local buttons = {"Idle", "Sit", "Dance"}
  39. for i, name in ipairs(buttons) do
  40. local button = Instance.new("TextButton")
  41. button.Size = UDim2.new(0.8, 0, 0, 40)
  42. button.Position = UDim2.new(0.1, 0, 0, i * 50 - 30)
  43. button.Text = name
  44. button.BackgroundColor3 = Color3.fromRGB(255, 105, 180)
  45. button.TextColor3 = Color3.new(1, 1, 1)
  46. button.Parent = frame
  47.  
  48. button.MouseButton1Click:Connect(function()
  49. currentAnim = name:upper()
  50. end)
  51. end
  52.  
  53. frame.Parent = screenGui
  54. screenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
  55. end
  56.  
  57. local function createCompanion(player)
  58. local character = player.Character or player.CharacterAdded:Wait()
  59. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  60.  
  61. local companion = Instance.new("Model")
  62. companion.Name = "Companion"
  63.  
  64. local humanoid = Instance.new("Humanoid")
  65. humanoid.Parent = companion
  66.  
  67. -- Create parts
  68. local head = Instance.new("Part")
  69. local torso = Instance.new("Part")
  70. local leftLeg = Instance.new("Part")
  71. local rightLeg = Instance.new("Part")
  72. local leftArm = Instance.new("Part")
  73. local rightArm = Instance.new("Part")
  74.  
  75. head.Size = Vector3.new(1.2, 1.2, 1.2)
  76. head.BrickColor = BrickColor.new("White")
  77. head.Name = "Head"
  78. head.CanCollide = false
  79.  
  80. torso.Size = Vector3.new(2, 2, 1)
  81. torso.BrickColor = BrickColor.new("Pink")
  82. torso.Name = "Torso"
  83. torso.CanCollide = false
  84.  
  85. leftLeg.Size = Vector3.new(1, 2, 1)
  86. rightLeg.Size = Vector3.new(1, 2, 1)
  87. leftLeg.BrickColor = BrickColor.new("Navy blue")
  88. rightLeg.BrickColor = BrickColor.new("Navy blue")
  89. leftLeg.CanCollide = false
  90. rightLeg.CanCollide = false
  91.  
  92. leftArm.Size = Vector3.new(1, 2, 1)
  93. rightArm.Size = Vector3.new(1, 2, 1)
  94. leftArm.BrickColor = BrickColor.new("White")
  95. rightArm.BrickColor = BrickColor.new("White")
  96. leftArm.CanCollide = false
  97. rightArm.CanCollide = false
  98.  
  99. local parts = {head, torso, leftLeg, rightLeg, leftArm, rightArm}
  100. for _, part in ipairs(parts) do
  101. part.Parent = companion
  102. end
  103.  
  104. -- Create welds
  105. local welds = {}
  106.  
  107. welds.head = Instance.new("Weld")
  108. welds.head.Part0 = torso
  109. welds.head.Part1 = head
  110. welds.head.Parent = torso
  111.  
  112. welds.leftLeg = Instance.new("Weld")
  113. welds.leftLeg.Part0 = torso
  114. welds.leftLeg.Part1 = leftLeg
  115. welds.leftLeg.Parent = torso
  116.  
  117. welds.rightLeg = Instance.new("Weld")
  118. welds.rightLeg.Part0 = torso
  119. welds.rightLeg.Part1 = rightLeg
  120. welds.rightLeg.Parent = torso
  121.  
  122. welds.leftArm = Instance.new("Weld")
  123. welds.leftArm.Part0 = torso
  124. welds.leftArm.Part1 = leftArm
  125. welds.leftArm.Parent = torso
  126.  
  127. welds.rightArm = Instance.new("Weld")
  128. welds.rightArm.Part0 = torso
  129. welds.rightArm.Part1 = rightArm
  130. welds.rightArm.Parent = torso
  131.  
  132. companion.PrimaryPart = torso
  133.  
  134. local time = 0
  135. RunService.Heartbeat:Connect(function(deltaTime)
  136. time += deltaTime
  137.  
  138. -- Apply current animation
  139. local targetAnim = ANIMS[currentAnim]
  140. for part, targetCF in pairs(targetAnim) do
  141. if currentAnim == "DANCE" then
  142. -- Add dancing motion
  143. targetCF = targetCF * CFrame.Angles(0, math.sin(time * 5) * 0.3, 0)
  144. end
  145. welds[part].C0 = welds[part].C0:Lerp(targetCF, 0.1)
  146. end
  147.  
  148. -- Update position
  149. if humanoidRootPart then
  150. companion:SetPrimaryPartCFrame(humanoidRootPart.CFrame * CFrame.new(2.5, 0, 0))
  151. end
  152. end)
  153.  
  154. companion.Parent = workspace
  155. return companion
  156. end
  157.  
  158. local function init()
  159. createGUI()
  160. local player = Players.LocalPlayer
  161. player.CharacterAdded:Connect(function()
  162. task.wait(1)
  163. createCompanion(player)
  164. end)
  165.  
  166. if player.Character then
  167. createCompanion(player)
  168. end
  169. end
  170.  
  171. init()
  172.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement