Advertisement
lafur

Untitled

May 23rd, 2020
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.68 KB | None | 0 0
  1. -- Converted using Mokiros's Model to Script plugin
  2. -- Converted string size: 5990
  3. local genv={}
  4. local Scripts = {
  5. function() function findNearestTorso(pos)
  6. local list = game.Workspace:children()
  7. local torso = nil
  8. local dist = 1000
  9. local temp = nil
  10. local human = nil
  11. local temp2 = nil
  12. for x = 1, #list do
  13. temp2 = list[x]
  14. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  15. temp = temp2:findFirstChild("Torso")
  16. human = temp2:findFirstChild("Humanoid")
  17. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  18. if (temp.Position - pos).magnitude < dist then
  19. torso = temp
  20. dist = (temp.Position - pos).magnitude
  21. end
  22. end
  23. end
  24. end
  25. return torso
  26. end
  27. --wait(math.random(0,5)/10)
  28. while true do
  29. wait(0.5)
  30. local target = findNearestTorso(script.Parent.Torso.Position)
  31. if target ~= nil then
  32. script.Parent.Humanoid:MoveTo(target.Position, target)
  33. end
  34. end end;
  35. function() --[[
  36.  
  37. ____________________________________________________________________________________________________________________
  38.  
  39. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  40. ____________________________________________________________________________________________________________________
  41. ___ ___
  42. ( ) ( ) .-.
  43. .--. .--. | |_ | |_ ( __) ___ .-. .--. .--.
  44. / _ \ / \ ( __) ( __) (''") ( ) \ / \ / _ \
  45. . .' `. ; | .-. ; | | | | | | | .-. . ; ,-. ' . .' `. ;
  46. | ' | | | | | | | | ___ | | ___ | | | | | | | | | | | ' | |
  47. _\_`.(___) | |/ | | |( ) | |( ) | | | | | | | | | | _\_`.(___)
  48. ( ). '. | ' _.' | | | | | | | | | | | | | | | | | | ( ). '.
  49. | | `\ | | .'.-. | ' | | | ' | | | | | | | | | ' | | | | `\ |
  50. ; '._,' ' ' `-' / ' `-' ; ' `-' ; | | | | | | ' `-' | ; '._,' '
  51. '.___.' `.__.' `.__. `.__. (___) (___)(___) `.__. | '.___.'
  52. ( `-' ;
  53. `.__.
  54. ____________________________________________________________________________________________________________________
  55.  
  56. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  57. ____________________________________________________________________________________________________________________
  58.  
  59. --]]
  60.  
  61.  
  62. local SearchDistance = 100000 -- How far a player can be before it detects you
  63.  
  64. local aiDamage = 0 -- How much damage the ai inficts towards the player
  65.  
  66. --[[
  67.  
  68. ____________________________________________________________________________________________________________________
  69.  
  70. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  71. ____________________________________________________________________________________________________________________
  72.  
  73. -- OPTIONAL --]]
  74.  
  75. local canWander = false
  76. local WanderX, WanderZ = 30, 30
  77. -- How many studs the ai can wander on the x and z axis in studs
  78.  
  79. --]]
  80.  
  81.  
  82. function getHumanoid(model)
  83. for _, v in pairs(model:GetChildren()) do
  84. if v:IsA'Humanoid' then
  85. return v
  86. end
  87. end
  88. end
  89.  
  90.  
  91. local ai = script.Parent
  92. local human = getHumanoid(ai)
  93. local hroot = ai.HumanoidRootPart
  94. local zspeed = hroot.Velocity.magnitude
  95.  
  96.  
  97. local pfs = game:GetService("PathfindingService")
  98.  
  99. function GetPlayerNames()
  100. local players = game:GetService('Players'):GetChildren()
  101. local name = nil
  102. for _, v in pairs(players) do
  103. if v:IsA'Player' then
  104. name = tostring(v.Name)
  105. end
  106. end
  107. return name
  108. end
  109.  
  110. spawn(function()
  111. while wait() do
  112. print("THIS BALDI MODEL WAS MADE BY ANPHU04, DO NOT TRUST ANYBODY THAT USES THIS!")
  113. end
  114. end)
  115.  
  116. function GetPlayersBodyParts(t)
  117. local torso = t
  118. if torso then
  119. local figure = torso.Parent
  120. for _, v in pairs(figure:GetChildren()) do
  121. if v:IsA'Part' then
  122. return v.Name
  123. end
  124. end
  125. else
  126. return "HumanoidRootPart"
  127. end
  128. end
  129.  
  130. function GetTorso(part)
  131. local chars = game.Workspace:GetChildren()
  132. local torso = nil
  133. for _, v in pairs(chars) do
  134. if v:IsA'Model' and v ~= script.Parent and v.Name == GetPlayerNames() then
  135. local charRoot = v:FindFirstChild'HumanoidRootPart'
  136. if (charRoot.Position - part).magnitude < SearchDistance then
  137. torso = charRoot
  138. end
  139. end
  140. end
  141. return torso
  142. end
  143.  
  144. for _, zambieparts in pairs(ai:GetChildren()) do
  145. if zambieparts:IsA'Part' then
  146. zambieparts.Touched:connect(function(p)
  147. if p.Parent.Name == GetPlayerNames() and p.Parent.Name ~= ai.Name then -- damage
  148. local enemy = p.Parent
  149. local enemyhuman = getHumanoid(enemy)
  150. enemyhuman:TakeDamage(aiDamage)
  151. end
  152. end)
  153. end
  154. end
  155.  
  156. -- no touchy
  157. local path
  158. local waypoint
  159. local oldpoints
  160. local isWandering = 0
  161.  
  162. if canWander then
  163. spawn(function()
  164. while isWandering == 0 do
  165. isWandering = 1
  166. local desgx, desgz = hroot.Position.x + math.random(-WanderX, WanderX), hroot.Position.z + math.random(-WanderZ, WanderZ)
  167. human:MoveTo( Vector3.new(desgx, 0, desgz) )
  168. wait(math.random(4, 6))
  169. isWandering = 0
  170. end
  171. end)
  172. end
  173.  
  174. while wait() do
  175. local enemytorso = GetTorso(hroot.Position)
  176. if enemytorso ~= nil then -- if player detected
  177. isWandering = 1
  178. local function checkw(t)
  179. local ci = 3
  180. if ci > #t then
  181. ci = 3
  182. end
  183. if t[ci] == nil and ci < #t then
  184. repeat
  185. ci = ci + 1
  186. wait()
  187. until t[ci] ~= nil
  188. return Vector3.new(1, 0, 0) + t[ci]
  189. else
  190. ci = 3
  191. return t[ci]
  192. end
  193. end
  194.  
  195. path = pfs:FindPathAsync(hroot.Position, enemytorso.Position)
  196. waypoint = path:GetWaypoints()
  197. oldpoints = waypoint
  198. local connection;
  199.  
  200. local direct = Vector3.FromNormalId(Enum.NormalId.Front)
  201. local ncf = hroot.CFrame * CFrame.new(direct)
  202. direct = ncf.p.unit
  203. local rootr = Ray.new(hroot.Position, direct)
  204. local phit, ppos = game.Workspace:FindPartOnRay(rootr, hroot)
  205.  
  206. if path and waypoint or checkw(waypoint) then
  207. if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
  208. human:MoveTo( checkw(waypoint).Position )
  209. human.Jump = false
  210. end
  211.  
  212. -- CANNOT LET BALDI JUMPS --
  213. --[[if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Jump then
  214. human.Jump = true
  215. connection = human.Changed:connect(function()
  216. human.Jump = true
  217. end)
  218. human:MoveTo( checkw(waypoint).Position )
  219. else
  220. human.Jump = false
  221. end]]
  222.  
  223. --[[hroot.Touched:connect(function(p)
  224. local bodypartnames = GetPlayersBodyParts(enemytorso)
  225. if p:IsA'Part' and not p.Name == bodypartnames and phit and phit.Name ~= bodypartnames and phit:IsA'Part' and rootr:Distance(phit.Position) < 5 then
  226. connection = human.Changed:connect(function()
  227. human.Jump = true
  228. end)
  229. else
  230. human.Jump = false
  231. end
  232. end)]]
  233.  
  234. if connection then
  235. connection:Disconnect()
  236. end
  237.  
  238. else
  239. for i = 3, #oldpoints do
  240. human:MoveTo( oldpoints[i].Position )
  241. end
  242. end
  243. elseif enemytorso == nil and canWander then -- if player not detected
  244. isWandering = 0
  245. path = nil
  246. waypoint = nil
  247. human.MoveToFinished:Wait()
  248. end
  249. end end;
  250. function() function waitForChild(parent, childName)
  251. local child = parent:findFirstChild(childName)
  252. if child then return child end
  253. while true do
  254. child = parent.ChildAdded:wait()
  255. if child.Name==childName then return child end
  256. end
  257. end
  258. local Figure = script.Parent
  259. local Torso = waitForChild(Figure, "Torso")
  260. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  261. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  262. local RightHip = waitForChild(Torso, "Right Hip")
  263. local LeftHip = waitForChild(Torso, "Left Hip")
  264. local Neck = waitForChild(Torso, "Neck")
  265. local Humanoid;
  266. for _,Child in pairs(Figure:GetChildren())do
  267. if Child and Child.ClassName=="Humanoid"then
  268. Humanoid=Child;
  269. end;
  270. end;
  271. local pose = "Standing"
  272. local currentAnim = ""
  273. local currentAnimInstance = nil
  274. local currentAnimTrack = nil
  275. local currentAnimKeyframeHandler = nil
  276. local currentAnimSpeed = 1.0
  277. local animTable = {}
  278. local animNames = {
  279. idle = {
  280. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  281. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  282. },
  283. walk = {
  284. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  285. },
  286. run = {
  287. { id = "http://www.roblox.com/asset/?id=252557606", weight = 20 }
  288. },
  289. jump = {
  290. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  291. },
  292. fall = {
  293. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  294. },
  295. climb = {
  296. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  297. },
  298. sit = {
  299. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  300. },
  301. toolnone = {
  302. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  303. },
  304. toolslash = {
  305. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  306. --{ id = "slash.xml", weight = 10 }
  307. },
  308. toollunge = {
  309. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  310. },
  311. wave = {
  312. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  313. },
  314. point = {
  315. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  316. },
  317. dance1 = {
  318. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  319. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  320. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  321. },
  322. dance2 = {
  323. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  324. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  325. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  326. },
  327. dance3 = {
  328. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  329. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  330. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  331. },
  332. laugh = {
  333. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  334. },
  335. cheer = {
  336. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  337. },
  338. }
  339. local dances = {"dance1", "dance2", "dance3"}
  340.  
  341. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  342. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  343.  
  344. function configureAnimationSet(name, fileList)
  345. if (animTable[name] ~= nil) then
  346. for _, connection in pairs(animTable[name].connections) do
  347. connection:disconnect()
  348. end
  349. end
  350. animTable[name] = {}
  351. animTable[name].count = 0
  352. animTable[name].totalWeight = 0
  353. animTable[name].connections = {}
  354.  
  355. -- check for config values
  356. local config = script:FindFirstChild(name)
  357. if (config ~= nil) then
  358. --print("Loading anims " .. name)
  359. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  360. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  361. local idx = 1
  362. for _, childPart in pairs(config:GetChildren()) do
  363. if (childPart:IsA("Animation")) then
  364. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  365. animTable[name][idx] = {}
  366. animTable[name][idx].anim = childPart
  367. local weightObject = childPart:FindFirstChild("Weight")
  368. if (weightObject == nil) then
  369. animTable[name][idx].weight = 1
  370. else
  371. animTable[name][idx].weight = weightObject.Value
  372. end
  373. animTable[name].count = animTable[name].count + 1
  374. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  375. --print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  376. idx = idx + 1
  377. end
  378. end
  379. end
  380.  
  381. -- fallback to defaults
  382. if (animTable[name].count <= 0) then
  383. for idx, anim in pairs(fileList) do
  384. animTable[name][idx] = {}
  385. animTable[name][idx].anim = Instance.new("Animation")
  386. animTable[name][idx].anim.Name = name
  387. animTable[name][idx].anim.AnimationId = anim.id
  388. animTable[name][idx].weight = anim.weight
  389. animTable[name].count = animTable[name].count + 1
  390. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  391. --print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  392. end
  393. end
  394. end
  395.  
  396. -- Setup animation objects
  397. function scriptChildModified(child)
  398. local fileList = animNames[child.Name]
  399. if (fileList ~= nil) then
  400. configureAnimationSet(child.Name, fileList)
  401. end
  402. end
  403.  
  404. script.ChildAdded:connect(scriptChildModified)
  405. script.ChildRemoved:connect(scriptChildModified)
  406.  
  407.  
  408. for name, fileList in pairs(animNames) do
  409. configureAnimationSet(name, fileList)
  410. end
  411.  
  412. -- ANIMATION
  413.  
  414. -- declarations
  415. local toolAnim = "None"
  416. local toolAnimTime = 0
  417.  
  418. local jumpAnimTime = 0
  419. local jumpAnimDuration = 0.3
  420.  
  421. local toolTransitionTime = 0.1
  422. local fallTransitionTime = 0.3
  423. local jumpMaxLimbVelocity = 0.75
  424.  
  425. -- functions
  426.  
  427. function stopAllAnimations()
  428. local oldAnim = currentAnim
  429.  
  430. -- return to idle if finishing an emote
  431. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  432. oldAnim = "idle"
  433. end
  434.  
  435. currentAnim = ""
  436. currentAnimInstance = nil
  437. if (currentAnimKeyframeHandler ~= nil) then
  438. currentAnimKeyframeHandler:disconnect()
  439. end
  440.  
  441. if (currentAnimTrack ~= nil) then
  442. currentAnimTrack:Stop()
  443. currentAnimTrack:Destroy()
  444. currentAnimTrack = nil
  445. end
  446. return oldAnim
  447. end
  448.  
  449. function setAnimationSpeed(speed)
  450. if speed ~= currentAnimSpeed then
  451. currentAnimSpeed = speed
  452. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  453. end
  454. end
  455.  
  456. function keyFrameReachedFunc(frameName)
  457. if (frameName == "End") then
  458.  
  459. local repeatAnim = currentAnim
  460. -- return to idle if finishing an emote
  461. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  462. repeatAnim = "idle"
  463. end
  464.  
  465. local animSpeed = currentAnimSpeed
  466. playAnimation(repeatAnim, 0.0, Humanoid)
  467. setAnimationSpeed(animSpeed)
  468. end
  469. end
  470.  
  471. -- Preload animations
  472. function playAnimation(animName, transitionTime, humanoid)
  473.  
  474. local roll = math.random(1, animTable[animName].totalWeight)
  475. local origRoll = roll
  476. local idx = 1
  477. while (roll > animTable[animName][idx].weight) do
  478. roll = roll - animTable[animName][idx].weight
  479. idx = idx + 1
  480. end
  481. --print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  482. local anim = animTable[animName][idx].anim
  483. -- switch animation
  484. if (anim ~= currentAnimInstance) then
  485. if (currentAnimTrack ~= nil) then
  486. currentAnimTrack:Stop(transitionTime)
  487. currentAnimTrack:Destroy()
  488. end
  489. currentAnimSpeed = 1.0
  490. -- load it to the humanoid; get AnimationTrack
  491. currentAnimTrack = humanoid:LoadAnimation(anim)
  492. -- play the animation
  493. currentAnimTrack:Play(transitionTime)
  494. currentAnim = animName
  495. currentAnimInstance = anim
  496. -- set up keyframe name triggers
  497. if (currentAnimKeyframeHandler ~= nil) then
  498. currentAnimKeyframeHandler:disconnect()
  499. end
  500. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  501. end
  502. end
  503. -------------------------------------------------------------------------------------------
  504. -------------------------------------------------------------------------------------------
  505. local toolAnimName = ""
  506. local toolAnimTrack = nil
  507. local toolAnimInstance = nil
  508. local currentToolAnimKeyframeHandler = nil
  509. function toolKeyFrameReachedFunc(frameName)
  510. if (frameName == "End") then
  511. --print("Keyframe : ".. frameName)
  512. playToolAnimation(toolAnimName, 0.0, Humanoid)
  513. end
  514. end
  515. function playToolAnimation(animName, transitionTime, humanoid)
  516. local roll = math.random(1, animTable[animName].totalWeight)
  517. local origRoll = roll
  518. local idx = 1
  519. while (roll > animTable[animName][idx].weight) do
  520. roll = roll - animTable[animName][idx].weight
  521. idx = idx + 1
  522. end
  523. --print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  524. local anim = animTable[animName][idx].anim
  525. if (toolAnimInstance ~= anim) then
  526. if (toolAnimTrack ~= nil) then
  527. toolAnimTrack:Stop()
  528. toolAnimTrack:Destroy()
  529. transitionTime = 0
  530. end
  531. -- load it to the humanoid; get AnimationTrack
  532. toolAnimTrack = humanoid:LoadAnimation(anim)
  533. -- play the animation
  534. toolAnimTrack:Play(transitionTime)
  535. toolAnimName = animName
  536. toolAnimInstance = anim
  537. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  538. end
  539. end
  540. function stopToolAnimations()
  541. local oldAnim = toolAnimName
  542. if (currentToolAnimKeyframeHandler ~= nil) then
  543. currentToolAnimKeyframeHandler:disconnect()
  544. end
  545. toolAnimName = ""
  546. toolAnimInstance = nil
  547. if (toolAnimTrack ~= nil) then
  548. toolAnimTrack:Stop()
  549. toolAnimTrack:Destroy()
  550. toolAnimTrack = nil
  551. end
  552. return oldAnim
  553. end
  554. -------------------------------------------------------------------------------------------
  555. -------------------------------------------------------------------------------------------
  556. function onRunning(speed)
  557. if speed>0.01 then
  558. if Figure and Humanoid and Humanoid.WalkSpeed<17 then
  559. playAnimation("walk", 0.1, Humanoid);
  560. elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
  561. playAnimation("run", 0.1, Humanoid);
  562. end;
  563. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  564. setAnimationSpeed(speed / 14.5)
  565. end
  566. pose = "Running"
  567. else
  568. playAnimation("idle", 0.1, Humanoid)
  569. pose = "Standing"
  570. end
  571. end
  572. function onDied()
  573. pose = "Dead"
  574. end
  575. function onJumping()
  576. playAnimation("jump", 0.1, Humanoid)
  577. jumpAnimTime = jumpAnimDuration
  578. pose = "Jumping"
  579. end
  580. function onClimbing(speed)
  581. playAnimation("climb", 0.1, Humanoid)
  582. setAnimationSpeed(speed / 12.0)
  583. pose = "Climbing"
  584. end
  585. function onGettingUp()
  586. pose = "GettingUp"
  587. end
  588. function onFreeFall()
  589. if (jumpAnimTime <= 0) then
  590. playAnimation("fall", fallTransitionTime, Humanoid)
  591. end
  592. pose = "FreeFall"
  593. end
  594. function onFallingDown()
  595. pose = "FallingDown"
  596. end
  597. function onSeated()
  598. pose = "Seated"
  599. end
  600. function onPlatformStanding()
  601. pose = "PlatformStanding"
  602. end
  603. function onSwimming(speed)
  604. if speed>0 then
  605. pose = "Running"
  606. else
  607. pose = "Standing"
  608. end
  609. end
  610.  
  611. function getTool()
  612. for _, kid in ipairs(Figure:GetChildren()) do
  613. if kid.className == "Tool" then return kid end
  614. end
  615. return nil
  616. end
  617.  
  618. function getToolAnim(tool)
  619. for _, c in ipairs(tool:GetChildren()) do
  620. if c.Name == "toolanim" and c.className == "StringValue" then
  621. return c
  622. end
  623. end
  624. return nil
  625. end
  626.  
  627. function animateTool()
  628.  
  629. if (toolAnim == "None") then
  630. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  631. return
  632. end
  633.  
  634. if (toolAnim == "Slash") then
  635. playToolAnimation("toolslash", 0, Humanoid)
  636. return
  637. end
  638.  
  639. if (toolAnim == "Lunge") then
  640. playToolAnimation("toollunge", 0, Humanoid)
  641. return
  642. end
  643. end
  644.  
  645. function moveSit()
  646. RightShoulder.MaxVelocity = 0.15
  647. LeftShoulder.MaxVelocity = 0.15
  648. RightShoulder:SetDesiredAngle(3.14 /2)
  649. LeftShoulder:SetDesiredAngle(-3.14 /2)
  650. RightHip:SetDesiredAngle(3.14 /2)
  651. LeftHip:SetDesiredAngle(-3.14 /2)
  652. end
  653.  
  654. local lastTick = 0
  655.  
  656. function move(time)
  657. local amplitude = 1
  658. local frequency = 1
  659. local deltaTime = time - lastTick
  660. lastTick = time
  661.  
  662. local climbFudge = 0
  663. local setAngles = false
  664.  
  665. if (jumpAnimTime > 0) then
  666. jumpAnimTime = jumpAnimTime - deltaTime
  667. end
  668.  
  669. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  670. playAnimation("fall", fallTransitionTime, Humanoid)
  671. elseif (pose == "Seated") then
  672. playAnimation("sit", 0.5, Humanoid)
  673. return
  674. elseif (pose == "Running") then
  675. if Figure and Humanoid and Humanoid.WalkSpeed<17 then
  676. playAnimation("walk", 0.1, Humanoid);
  677. elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
  678. playAnimation("run", 0.1, Humanoid);
  679. end;
  680. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  681. stopAllAnimations()
  682. amplitude = 0.1
  683. frequency = 1
  684. setAngles = true
  685. end
  686. if (setAngles) then
  687. local desiredAngle = amplitude * math.sin(time * frequency)
  688. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  689. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  690. RightHip:SetDesiredAngle(-desiredAngle)
  691. LeftHip:SetDesiredAngle(-desiredAngle)
  692. end
  693. -- Tool Animation handling
  694. local tool = getTool()
  695. if tool and tool:FindFirstChild("Handle") then
  696. local animStringValueObject = getToolAnim(tool)
  697. if animStringValueObject then
  698. toolAnim = animStringValueObject.Value
  699. -- message recieved, delete StringValue
  700. animStringValueObject.Parent = nil
  701. toolAnimTime = time + .3
  702. end
  703. if time > toolAnimTime then
  704. toolAnimTime = 0
  705. toolAnim = "None"
  706. end
  707. animateTool()
  708. else
  709. stopToolAnimations()
  710. toolAnim = "None"
  711. toolAnimInstance = nil
  712. toolAnimTime = 0
  713. end
  714. end
  715. -- connect events
  716. Humanoid.Died:connect(onDied)
  717. Humanoid.Running:connect(onRunning)
  718. Humanoid.Jumping:connect(onJumping)
  719. Humanoid.Climbing:connect(onClimbing)
  720. Humanoid.GettingUp:connect(onGettingUp)
  721. Humanoid.FreeFalling:connect(onFreeFall)
  722. Humanoid.FallingDown:connect(onFallingDown)
  723. Humanoid.Seated:connect(onSeated)
  724. Humanoid.PlatformStanding:connect(onPlatformStanding)
  725. Humanoid.Swimming:connect(onSwimming)
  726. local runService = game:GetService("RunService");
  727. playAnimation("idle", 0.1, Humanoid)
  728. pose = "Standing"
  729. while Wait(0)do
  730. local _,time=wait(0)
  731. move(time)
  732. end end;
  733. function() --[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]--
  734. local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]--
  735. local AdvancedRespawnScript=script;
  736. repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
  737. local JeffTheKiller=AdvancedRespawnScript.Parent;
  738. if AdvancedRespawnScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then
  739. JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();
  740. end;
  741. local GameDerbis=Game:GetService("Debris");
  742. local JeffTheKillerHumanoid;
  743. for _,Child in pairs(JeffTheKiller:GetChildren())do
  744. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  745. JeffTheKillerHumanoid=Child;
  746. end;
  747. end;
  748. local Respawndant=JeffTheKiller:Clone();
  749. if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
  750. coroutine.resume(coroutine.create(function()
  751. if JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid:FindFirstChild("Status")and not JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
  752. SpawnModel=Instance.new("Model");
  753. SpawnModel.Parent=JeffTheKillerHumanoid.Status;
  754. SpawnModel.Name="AvalibleSpawns";
  755. else
  756. SpawnModel=JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
  757. end;
  758. function FindSpawn(SearchValue)
  759. local PartsArchivable=SearchValue:GetChildren();
  760. for AreaSearch=1,#PartsArchivable do
  761. if PartsArchivable[AreaSearch].className=="SpawnLocation"then
  762. local PositionValue=Instance.new("Vector3Value",SpawnModel);
  763. PositionValue.Value=PartsArchivable[AreaSearch].Position;
  764. PositionValue.Name=PartsArchivable[AreaSearch].Duration;
  765. end;
  766. FindSpawn(PartsArchivable[AreaSearch]);
  767. end;
  768. end;
  769. FindSpawn(Game:GetService("Workspace"));
  770. local SpawnChilden=SpawnModel:GetChildren();
  771. if#SpawnChilden>0 then
  772. local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
  773. local RespawningForceField=Instance.new("ForceField");
  774. RespawningForceField.Parent=JeffTheKiller;
  775. RespawningForceField.Name="SpawnForceField";
  776. GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
  777. JeffTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
  778. else
  779. if JeffTheKiller:FindFirstChild("SpawnForceField")then
  780. JeffTheKiller:FindFirstChild("SpawnForceField"):Destroy();
  781. end;
  782. JeffTheKiller:MoveTo(Vector3.new(0,115,0));
  783. end;
  784. end));
  785. end;
  786. function Respawn()
  787. Wait(5);
  788. Respawndant.Parent=JeffTheKiller.Parent;
  789. Respawndant:makeJoints();
  790. Respawndant:FindFirstChild("Head"):MakeJoints();
  791. Respawndant:FindFirstChild("Torso"):MakeJoints();
  792. JeffTheKiller:remove();
  793. end;
  794. if AdvancedRespawnScript and JeffTheKiller and JeffTheKillerHumanoid then
  795. JeffTheKillerHumanoid.Died:connect(Respawn);
  796. end;
  797. --[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]-- end;
  798. function() --Responsible for regening a player's humanoid's health
  799.  
  800. -- declarations
  801. local Figure = script.Parent
  802. local Head = Figure:WaitForChild("Head")
  803. local Humanoid;
  804. for _,Child in pairs(Figure:GetChildren())do
  805. if Child and Child.ClassName=="Humanoid"then
  806. Humanoid=Child;
  807. end;
  808. end;
  809. local regening = false
  810.  
  811. -- regeneration
  812. function regenHealth()
  813. if regening then return end
  814. regening = true
  815.  
  816. while Humanoid.Health < Humanoid.MaxHealth do
  817. local s = wait(1)
  818. local health = Humanoid.Health
  819. if health~=0 and health < Humanoid.MaxHealth then
  820. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  821. health = health + newHealthDelta
  822. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  823. end
  824. end
  825.  
  826. if Humanoid.Health > Humanoid.MaxHealth then
  827. Humanoid.Health = Humanoid.MaxHealth
  828. end
  829.  
  830. regening = false
  831. end
  832.  
  833. Humanoid.HealthChanged:connect(regenHealth)
  834. end;
  835. function() -- Created by Quenty (@Quenty, follow me on twitter).
  836. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  837. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  838.  
  839. --[[ INSTRUCTIONS
  840. - Place in the model
  841. - Make sure model is anchored
  842. - That's it. It will weld the model and all children.
  843.  
  844. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  845. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  846. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  847. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  848. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  849. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  850. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  851. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  852.  
  853. This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
  854. ]]
  855.  
  856. --[[ DOCUMENTATION
  857. - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
  858. - Will work in PBS servers
  859. - Will work as long as it starts out with the part anchored
  860. - Stores the relative CFrame as a CFrame value
  861. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  862. - Utilizes a recursive algorith to find all parts in the model
  863. - Will reweld on script reparent if the script is initially parented to a tool.
  864. - Welds as fast as possible
  865. ]]
  866.  
  867. -- qPerfectionWeld.lua
  868. -- Created 10/6/2014
  869. -- Author: Quenty
  870. -- Version 1.0.3
  871.  
  872. -- Updated 10/14/2014 - Updated to 1.0.1
  873. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  874.  
  875. -- Updated 10/14/2014 - Updated to 1.0.2
  876. --- Fixed bug fix.
  877.  
  878. -- Updated 10/14/2014 - Updated to 1.0.3
  879. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  880.  
  881. local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
  882.  
  883.  
  884. local function CallOnChildren(Instance, FunctionToCall)
  885. -- Calls a function on each of the children of a certain object, using recursion.
  886.  
  887. FunctionToCall(Instance)
  888.  
  889. for _, Child in next, Instance:GetChildren() do
  890. CallOnChildren(Child, FunctionToCall)
  891. end
  892. end
  893.  
  894. local function GetNearestParent(Instance, ClassName)
  895. -- Returns the nearest parent of a certain class, or returns nil
  896.  
  897. local Ancestor = Instance
  898. repeat
  899. Ancestor = Ancestor.Parent
  900. if Ancestor == nil then
  901. return nil
  902. end
  903. until Ancestor:IsA(ClassName)
  904.  
  905. return Ancestor
  906. end
  907.  
  908. local function GetBricks(StartInstance)
  909. local List = {}
  910.  
  911. -- if StartInstance:IsA("BasePart") then
  912. -- List[#List+1] = StartInstance
  913. -- end
  914.  
  915. CallOnChildren(StartInstance, function(Item)
  916. if Item:IsA("BasePart") then
  917. List[#List+1] = Item;
  918. end
  919. end)
  920.  
  921. return List
  922. end
  923.  
  924. local function Modify(Instance, Values)
  925. -- Modifies an Instance by using a table.
  926.  
  927. assert(type(Values) == "table", "Values is not a table");
  928.  
  929. for Index, Value in next, Values do
  930. if type(Index) == "number" then
  931. Value.Parent = Instance
  932. else
  933. Instance[Index] = Value
  934. end
  935. end
  936. return Instance
  937. end
  938.  
  939. local function Make(ClassType, Properties)
  940. -- Using a syntax hack to create a nice way to Make new items.
  941.  
  942. return Modify(Instance.new(ClassType), Properties)
  943. end
  944.  
  945. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  946. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  947.  
  948. local function HasWheelJoint(Part)
  949. for _, SurfaceName in pairs(Surfaces) do
  950. for _, HingSurfaceName in pairs(HingSurfaces) do
  951. if Part[SurfaceName].Name == HingSurfaceName then
  952. return true
  953. end
  954. end
  955. end
  956.  
  957. return false
  958. end
  959.  
  960. local function ShouldBreakJoints(Part)
  961. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  962. -- definitely some edge cases.
  963.  
  964. if NEVER_BREAK_JOINTS then
  965. return false
  966. end
  967.  
  968. if HasWheelJoint(Part) then
  969. return false
  970. end
  971.  
  972. local Connected = Part:GetConnectedParts()
  973.  
  974. if #Connected == 1 then
  975. return false
  976. end
  977.  
  978. for _, Item in pairs(Connected) do
  979. if HasWheelJoint(Item) then
  980. return false
  981. elseif not Item:IsDescendantOf(script.Parent) then
  982. return false
  983. end
  984. end
  985.  
  986. return true
  987. end
  988.  
  989. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  990. --- Weld's 2 parts together
  991. -- @param Part0 The first part
  992. -- @param Part1 The second part (Dependent part most of the time).
  993. -- @param [JointType] The type of joint. Defaults to weld.
  994. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  995. -- @return The weld created.
  996.  
  997. JointType = JointType or "Weld"
  998. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  999.  
  1000. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1001. Modify(NewWeld, {
  1002. Name = "qCFrameWeldThingy";
  1003. Part0 = Part0;
  1004. Part1 = Part1;
  1005. C0 = CFrame.new();--Part0.CFrame:inverse();
  1006. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1007. Parent = Part1;
  1008. })
  1009.  
  1010. if not RelativeValue then
  1011. RelativeValue = Make("CFrameValue", {
  1012. Parent = Part1;
  1013. Name = "qRelativeCFrameWeldValue";
  1014. Archivable = true;
  1015. Value = NewWeld.C1;
  1016. })
  1017. end
  1018.  
  1019. return NewWeld
  1020. end
  1021.  
  1022. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1023. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1024. -- @param MainPart The part to weld the model to (can be in the model).
  1025. -- @param [JointType] The type of joint. Defaults to weld.
  1026. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1027.  
  1028. for _, Part in pairs(Parts) do
  1029. if ShouldBreakJoints(Part) then
  1030. Part:BreakJoints()
  1031. end
  1032. end
  1033.  
  1034. for _, Part in pairs(Parts) do
  1035. if Part ~= MainPart then
  1036. WeldTogether(MainPart, Part, JointType, MainPart)
  1037. end
  1038. end
  1039.  
  1040. if not DoNotUnanchor then
  1041. for _, Part in pairs(Parts) do
  1042. Part.Anchored = false
  1043. end
  1044. MainPart.Anchored = false
  1045. end
  1046. end
  1047.  
  1048. local function PerfectionWeld()
  1049. local Tool = GetNearestParent(script, "Tool")
  1050.  
  1051. local Parts = GetBricks(script.Parent)
  1052. local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
  1053.  
  1054. if PrimaryPart then
  1055. WeldParts(Parts, PrimaryPart, "Weld", false)
  1056. else
  1057. warn("qWeld - Unable to weld part")
  1058. end
  1059.  
  1060. return Tool
  1061. end
  1062.  
  1063. local Tool = PerfectionWeld()
  1064.  
  1065.  
  1066. if Tool and script.ClassName == "Script" then
  1067. --- Don't bother with local scripts
  1068.  
  1069. script.Parent.AncestryChanged:connect(function()
  1070. PerfectionWeld()
  1071. end)
  1072. end
  1073.  
  1074. -- Created by Quenty (@Quenty, follow me on twitter).
  1075. end;
  1076. function() function onTouched(hit)
  1077. local human = hit.Parent:findFirstChild("Humanoid")
  1078. if (human ~= nil) then
  1079. script.Parent.Dead:Play()
  1080. script.Parent.Parent.Parent.Head.PeppaPig:Stop()
  1081. wait(1)
  1082. human.Health = human.Health - 1000 -- Change the amount to change the damage.
  1083. script.Parent.Parent.Parent.Head.PeppaPig:Play()
  1084. wait(5)
  1085. end
  1086. end
  1087. script.Parent.Touched:connect(onTouched) end;
  1088. function() -- Created by Quenty (@Quenty, follow me on twitter).
  1089. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1090. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1091.  
  1092. --[[ INSTRUCTIONS
  1093. - Place in the model
  1094. - Make sure model is anchored
  1095. - That's it. It will weld the model and all children.
  1096.  
  1097. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1098. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1099. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1100. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1101. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1102. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1103. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1104. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1105.  
  1106. This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
  1107. ]]
  1108.  
  1109. --[[ DOCUMENTATION
  1110. - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
  1111. - Will work in PBS servers
  1112. - Will work as long as it starts out with the part anchored
  1113. - Stores the relative CFrame as a CFrame value
  1114. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1115. - Utilizes a recursive algorith to find all parts in the model
  1116. - Will reweld on script reparent if the script is initially parented to a tool.
  1117. - Welds as fast as possible
  1118. ]]
  1119.  
  1120. -- qPerfectionWeld.lua
  1121. -- Created 10/6/2014
  1122. -- Author: Quenty
  1123. -- Version 1.0.3
  1124.  
  1125. -- Updated 10/14/2014 - Updated to 1.0.1
  1126. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1127.  
  1128. -- Updated 10/14/2014 - Updated to 1.0.2
  1129. --- Fixed bug fix.
  1130.  
  1131. -- Updated 10/14/2014 - Updated to 1.0.3
  1132. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1133.  
  1134. local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
  1135.  
  1136.  
  1137. local function CallOnChildren(Instance, FunctionToCall)
  1138. -- Calls a function on each of the children of a certain object, using recursion.
  1139.  
  1140. FunctionToCall(Instance)
  1141.  
  1142. for _, Child in next, Instance:GetChildren() do
  1143. CallOnChildren(Child, FunctionToCall)
  1144. end
  1145. end
  1146.  
  1147. local function GetNearestParent(Instance, ClassName)
  1148. -- Returns the nearest parent of a certain class, or returns nil
  1149.  
  1150. local Ancestor = Instance
  1151. repeat
  1152. Ancestor = Ancestor.Parent
  1153. if Ancestor == nil then
  1154. return nil
  1155. end
  1156. until Ancestor:IsA(ClassName)
  1157.  
  1158. return Ancestor
  1159. end
  1160.  
  1161. local function GetBricks(StartInstance)
  1162. local List = {}
  1163.  
  1164. -- if StartInstance:IsA("BasePart") then
  1165. -- List[#List+1] = StartInstance
  1166. -- end
  1167.  
  1168. CallOnChildren(StartInstance, function(Item)
  1169. if Item:IsA("BasePart") then
  1170. List[#List+1] = Item;
  1171. end
  1172. end)
  1173.  
  1174. return List
  1175. end
  1176.  
  1177. local function Modify(Instance, Values)
  1178. -- Modifies an Instance by using a table.
  1179.  
  1180. assert(type(Values) == "table", "Values is not a table");
  1181.  
  1182. for Index, Value in next, Values do
  1183. if type(Index) == "number" then
  1184. Value.Parent = Instance
  1185. else
  1186. Instance[Index] = Value
  1187. end
  1188. end
  1189. return Instance
  1190. end
  1191.  
  1192. local function Make(ClassType, Properties)
  1193. -- Using a syntax hack to create a nice way to Make new items.
  1194.  
  1195. return Modify(Instance.new(ClassType), Properties)
  1196. end
  1197.  
  1198. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1199. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1200.  
  1201. local function HasWheelJoint(Part)
  1202. for _, SurfaceName in pairs(Surfaces) do
  1203. for _, HingSurfaceName in pairs(HingSurfaces) do
  1204. if Part[SurfaceName].Name == HingSurfaceName then
  1205. return true
  1206. end
  1207. end
  1208. end
  1209.  
  1210. return false
  1211. end
  1212.  
  1213. local function ShouldBreakJoints(Part)
  1214. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1215. -- definitely some edge cases.
  1216.  
  1217. if NEVER_BREAK_JOINTS then
  1218. return false
  1219. end
  1220.  
  1221. if HasWheelJoint(Part) then
  1222. return false
  1223. end
  1224.  
  1225. local Connected = Part:GetConnectedParts()
  1226.  
  1227. if #Connected == 1 then
  1228. return false
  1229. end
  1230.  
  1231. for _, Item in pairs(Connected) do
  1232. if HasWheelJoint(Item) then
  1233. return false
  1234. elseif not Item:IsDescendantOf(script.Parent) then
  1235. return false
  1236. end
  1237. end
  1238.  
  1239. return true
  1240. end
  1241.  
  1242. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1243. --- Weld's 2 parts together
  1244. -- @param Part0 The first part
  1245. -- @param Part1 The second part (Dependent part most of the time).
  1246. -- @param [JointType] The type of joint. Defaults to weld.
  1247. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1248. -- @return The weld created.
  1249.  
  1250. JointType = JointType or "Weld"
  1251. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1252.  
  1253. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1254. Modify(NewWeld, {
  1255. Name = "qCFrameWeldThingy";
  1256. Part0 = Part0;
  1257. Part1 = Part1;
  1258. C0 = CFrame.new();--Part0.CFrame:inverse();
  1259. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1260. Parent = Part1;
  1261. })
  1262.  
  1263. if not RelativeValue then
  1264. RelativeValue = Make("CFrameValue", {
  1265. Parent = Part1;
  1266. Name = "qRelativeCFrameWeldValue";
  1267. Archivable = true;
  1268. Value = NewWeld.C1;
  1269. })
  1270. end
  1271.  
  1272. return NewWeld
  1273. end
  1274.  
  1275. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1276. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1277. -- @param MainPart The part to weld the model to (can be in the model).
  1278. -- @param [JointType] The type of joint. Defaults to weld.
  1279. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1280.  
  1281. for _, Part in pairs(Parts) do
  1282. if ShouldBreakJoints(Part) then
  1283. Part:BreakJoints()
  1284. end
  1285. end
  1286.  
  1287. for _, Part in pairs(Parts) do
  1288. if Part ~= MainPart then
  1289. WeldTogether(MainPart, Part, JointType, MainPart)
  1290. end
  1291. end
  1292.  
  1293. if not DoNotUnanchor then
  1294. for _, Part in pairs(Parts) do
  1295. Part.Anchored = false
  1296. end
  1297. MainPart.Anchored = false
  1298. end
  1299. end
  1300.  
  1301. local function PerfectionWeld()
  1302. local Tool = GetNearestParent(script, "Tool")
  1303.  
  1304. local Parts = GetBricks(script.Parent)
  1305. local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
  1306.  
  1307. if PrimaryPart then
  1308. WeldParts(Parts, PrimaryPart, "Weld", false)
  1309. else
  1310. warn("qWeld - Unable to weld part")
  1311. end
  1312.  
  1313. return Tool
  1314. end
  1315.  
  1316. local Tool = PerfectionWeld()
  1317.  
  1318.  
  1319. if Tool and script.ClassName == "Script" then
  1320. --- Don't bother with local scripts
  1321.  
  1322. script.Parent.AncestryChanged:connect(function()
  1323. PerfectionWeld()
  1324. end)
  1325. end
  1326.  
  1327. -- Created by Quenty (@Quenty, follow me on twitter).
  1328. end;
  1329. function() -- Created by Quenty (@Quenty, follow me on twitter).
  1330. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1331. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1332.  
  1333. --[[ INSTRUCTIONS
  1334. - Place in the model
  1335. - Make sure model is anchored
  1336. - That's it. It will weld the model and all children.
  1337.  
  1338. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1339. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1340. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1341. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1342. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1343. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1344. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1345. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1346.  
  1347. This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
  1348. ]]
  1349.  
  1350. --[[ DOCUMENTATION
  1351. - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
  1352. - Will work in PBS servers
  1353. - Will work as long as it starts out with the part anchored
  1354. - Stores the relative CFrame as a CFrame value
  1355. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1356. - Utilizes a recursive algorith to find all parts in the model
  1357. - Will reweld on script reparent if the script is initially parented to a tool.
  1358. - Welds as fast as possible
  1359. ]]
  1360.  
  1361. -- qPerfectionWeld.lua
  1362. -- Created 10/6/2014
  1363. -- Author: Quenty
  1364. -- Version 1.0.3
  1365.  
  1366. -- Updated 10/14/2014 - Updated to 1.0.1
  1367. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1368.  
  1369. -- Updated 10/14/2014 - Updated to 1.0.2
  1370. --- Fixed bug fix.
  1371.  
  1372. -- Updated 10/14/2014 - Updated to 1.0.3
  1373. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1374.  
  1375. local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
  1376.  
  1377.  
  1378. local function CallOnChildren(Instance, FunctionToCall)
  1379. -- Calls a function on each of the children of a certain object, using recursion.
  1380.  
  1381. FunctionToCall(Instance)
  1382.  
  1383. for _, Child in next, Instance:GetChildren() do
  1384. CallOnChildren(Child, FunctionToCall)
  1385. end
  1386. end
  1387.  
  1388. local function GetNearestParent(Instance, ClassName)
  1389. -- Returns the nearest parent of a certain class, or returns nil
  1390.  
  1391. local Ancestor = Instance
  1392. repeat
  1393. Ancestor = Ancestor.Parent
  1394. if Ancestor == nil then
  1395. return nil
  1396. end
  1397. until Ancestor:IsA(ClassName)
  1398.  
  1399. return Ancestor
  1400. end
  1401.  
  1402. local function GetBricks(StartInstance)
  1403. local List = {}
  1404.  
  1405. -- if StartInstance:IsA("BasePart") then
  1406. -- List[#List+1] = StartInstance
  1407. -- end
  1408.  
  1409. CallOnChildren(StartInstance, function(Item)
  1410. if Item:IsA("BasePart") then
  1411. List[#List+1] = Item;
  1412. end
  1413. end)
  1414.  
  1415. return List
  1416. end
  1417.  
  1418. local function Modify(Instance, Values)
  1419. -- Modifies an Instance by using a table.
  1420.  
  1421. assert(type(Values) == "table", "Values is not a table");
  1422.  
  1423. for Index, Value in next, Values do
  1424. if type(Index) == "number" then
  1425. Value.Parent = Instance
  1426. else
  1427. Instance[Index] = Value
  1428. end
  1429. end
  1430. return Instance
  1431. end
  1432.  
  1433. local function Make(ClassType, Properties)
  1434. -- Using a syntax hack to create a nice way to Make new items.
  1435.  
  1436. return Modify(Instance.new(ClassType), Properties)
  1437. end
  1438.  
  1439. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1440. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1441.  
  1442. local function HasWheelJoint(Part)
  1443. for _, SurfaceName in pairs(Surfaces) do
  1444. for _, HingSurfaceName in pairs(HingSurfaces) do
  1445. if Part[SurfaceName].Name == HingSurfaceName then
  1446. return true
  1447. end
  1448. end
  1449. end
  1450.  
  1451. return false
  1452. end
  1453.  
  1454. local function ShouldBreakJoints(Part)
  1455. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1456. -- definitely some edge cases.
  1457.  
  1458. if NEVER_BREAK_JOINTS then
  1459. return false
  1460. end
  1461.  
  1462. if HasWheelJoint(Part) then
  1463. return false
  1464. end
  1465.  
  1466. local Connected = Part:GetConnectedParts()
  1467.  
  1468. if #Connected == 1 then
  1469. return false
  1470. end
  1471.  
  1472. for _, Item in pairs(Connected) do
  1473. if HasWheelJoint(Item) then
  1474. return false
  1475. elseif not Item:IsDescendantOf(script.Parent) then
  1476. return false
  1477. end
  1478. end
  1479.  
  1480. return true
  1481. end
  1482.  
  1483. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1484. --- Weld's 2 parts together
  1485. -- @param Part0 The first part
  1486. -- @param Part1 The second part (Dependent part most of the time).
  1487. -- @param [JointType] The type of joint. Defaults to weld.
  1488. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1489. -- @return The weld created.
  1490.  
  1491. JointType = JointType or "Weld"
  1492. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1493.  
  1494. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1495. Modify(NewWeld, {
  1496. Name = "qCFrameWeldThingy";
  1497. Part0 = Part0;
  1498. Part1 = Part1;
  1499. C0 = CFrame.new();--Part0.CFrame:inverse();
  1500. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1501. Parent = Part1;
  1502. })
  1503.  
  1504. if not RelativeValue then
  1505. RelativeValue = Make("CFrameValue", {
  1506. Parent = Part1;
  1507. Name = "qRelativeCFrameWeldValue";
  1508. Archivable = true;
  1509. Value = NewWeld.C1;
  1510. })
  1511. end
  1512.  
  1513. return NewWeld
  1514. end
  1515.  
  1516. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1517. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1518. -- @param MainPart The part to weld the model to (can be in the model).
  1519. -- @param [JointType] The type of joint. Defaults to weld.
  1520. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1521.  
  1522. for _, Part in pairs(Parts) do
  1523. if ShouldBreakJoints(Part) then
  1524. Part:BreakJoints()
  1525. end
  1526. end
  1527.  
  1528. for _, Part in pairs(Parts) do
  1529. if Part ~= MainPart then
  1530. WeldTogether(MainPart, Part, JointType, MainPart)
  1531. end
  1532. end
  1533.  
  1534. if not DoNotUnanchor then
  1535. for _, Part in pairs(Parts) do
  1536. Part.Anchored = false
  1537. end
  1538. MainPart.Anchored = false
  1539. end
  1540. end
  1541.  
  1542. local function PerfectionWeld()
  1543. local Tool = GetNearestParent(script, "Tool")
  1544.  
  1545. local Parts = GetBricks(script.Parent)
  1546. local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
  1547.  
  1548. if PrimaryPart then
  1549. WeldParts(Parts, PrimaryPart, "Weld", false)
  1550. else
  1551. warn("qWeld - Unable to weld part")
  1552. end
  1553.  
  1554. return Tool
  1555. end
  1556.  
  1557. local Tool = PerfectionWeld()
  1558.  
  1559.  
  1560. if Tool and script.ClassName == "Script" then
  1561. --- Don't bother with local scripts
  1562.  
  1563. script.Parent.AncestryChanged:connect(function()
  1564. PerfectionWeld()
  1565. end)
  1566. end
  1567.  
  1568. -- Created by Quenty (@Quenty, follow me on twitter).
  1569. end;}local ActualScripts = {}
  1570. function s(var)
  1571. local func = table.remove(Scripts,1)
  1572. setfenv(func,setmetatable({script=var,require=fake_require or require,global=genv},{
  1573. __index = getfenv(func),
  1574. }))
  1575. table.insert(ActualScripts,coroutine.wrap(func))
  1576. end
  1577. Decode = function(str,t,props,classes,values,ICList,Model,CurPar,LastIns,split,RemoveAndSplit,InstanceList)
  1578. local tonum,table_remove,inst,parnt,comma,table_foreach = tonumber,table.remove,Instance.new,"Parent",",",
  1579. function(t,f)
  1580. for a,b in pairs(t) do
  1581. f(a,b)
  1582. end
  1583. end
  1584. local Types = {
  1585. Color3 = Color3.new,
  1586. Vector3 = Vector3.new,
  1587. Vector2 = Vector2.new,
  1588. UDim = UDim.new,
  1589. UDim2 = UDim2.new,
  1590. CFrame = CFrame.new,
  1591. Rect = Rect.new,
  1592. NumberRange = NumberRange.new,
  1593. BrickColor = BrickColor.new,
  1594. PhysicalProperties = PhysicalProperties.new,
  1595. NumberSequence = function(...)
  1596. local a = {...}
  1597. local t = {}
  1598. repeat
  1599. t[#t+1] = NumberSequenceKeypoint.new(table_remove(a,1),table_remove(a,1),table_remove(a,1))
  1600. until #a==0
  1601. return NumberSequence.new(t)
  1602. end,
  1603. ColorSequence = function(...)
  1604. local a = {...}
  1605. local t = {}
  1606. repeat
  1607. t[#t+1] = ColorSequenceKeypoint.new(table_remove(a,1),Color3.new(table_remove(a,1),table_remove(a,1),table_remove(a,1)))
  1608. until #a==0
  1609. return ColorSequence.new(t)
  1610. end,
  1611. number = tonumber,
  1612. boolean = function(a)
  1613. return a=="1"
  1614. end
  1615. }
  1616. split = function(str,sep)
  1617. if not str then return end
  1618. local fields = {}
  1619. local ConcatNext = false
  1620. str:gsub(("([^%s]+)"):format(sep),function(c)
  1621. if ConcatNext == true then
  1622. fields[#fields] = fields[#fields]..sep..c
  1623. ConcatNext = false
  1624. else
  1625. fields[#fields+1] = c
  1626. end
  1627. if c:sub(#c)=="\\" then
  1628. c = fields[#fields]
  1629. fields[#fields] = c:sub(1,#c-1)
  1630. ConcatNext = true
  1631. end
  1632. end)
  1633. return fields
  1634. end
  1635. RemoveAndSplit = function(t)
  1636. return split(table_remove(t,1),comma)
  1637. end
  1638. t = split(str,";")
  1639. props = RemoveAndSplit(t)
  1640. classes = RemoveAndSplit(t)
  1641. values = split(table_remove(t,1),'|')
  1642. ICList = RemoveAndSplit(t)
  1643. InstanceList = {}
  1644. Model = inst"Model"
  1645. CurPar = Model
  1646. table_foreach(t,function(ct,c)
  1647. if c=="n" or c=="p" then
  1648. CurPar = c=="n" and LastIns or CurPar[parnt]
  1649. else
  1650. ct = split(c,"|")
  1651. local class = classes[tonum(table_remove(ct,1))]
  1652. if class=="UnionOperation" then
  1653. LastIns = {UsePartColor="1"}
  1654. else
  1655. LastIns = inst(class)
  1656. if LastIns:IsA"Script" then
  1657. s(LastIns)
  1658. elseif LastIns:IsA("ModuleScript") then
  1659. ms(LastIns)
  1660. end
  1661. end
  1662.  
  1663. local function SetProperty(LastIns,p,str,s)
  1664. s = Types[typeof(LastIns[p])]
  1665. if p=="CustomPhysicalProperties" then
  1666. s = PhysicalProperties.new
  1667. end
  1668. if s then
  1669. LastIns[p] = s(unpack(split(str,comma)))
  1670. else
  1671. LastIns[p] = str
  1672. end
  1673. end
  1674.  
  1675. local UnionData
  1676. table_foreach(ct,function(s,p,a,str)
  1677. a = p:find":"
  1678. p,str = props[tonum(p:sub(1,a-1))],values[tonum(p:sub(a+1))]
  1679. if p=="UnionData" then
  1680. UnionData = split(str," ")
  1681. return
  1682. end
  1683. if class=="UnionOperation" then
  1684. LastIns[p] = str
  1685. return
  1686. end
  1687. SetProperty(LastIns,p,str)
  1688. end)
  1689.  
  1690. if UnionData then
  1691. local LI_Data = LastIns
  1692. LastIns = DecodeUnion(UnionData)
  1693. table_foreach(LI_Data,function(p,str)
  1694. SetProperty(LastIns,p,str)
  1695. end)
  1696. end
  1697. table.insert(InstanceList,LastIns)
  1698. LastIns[parnt] = CurPar
  1699. end
  1700. end)
  1701. table_remove(ICList,1)
  1702. table_foreach(ICList,function(a,b)
  1703. b = split(b,">")
  1704. InstanceList[tonum(b[1])][props[tonum(b[2])]] = InstanceList[tonum(b[3])]
  1705. end)
  1706.  
  1707. return Model:GetChildren()
  1708. end
  1709.  
  1710. local Objects = Decode('Name,PrimaryPart,AnimationId,MeshId,BaseTextureId,BodyPart,OverlayTextureId,Value,HeadColor3,LeftArmColor3,RightArmColor3,LeftLegColor3,RightLegColor3,TorsoColor3,CustomPhysicalProperties,Color,Materi'
  1711. ..'al,Transparency,Position,Orientation,Size,CanCollide,BackSurface,BottomSurface,FrontSurface,LeftSurface,RightSurface,TopSurface,MaxVelocity,C0,C1,Part0,Part1,DisplayDistanceType,HealthDisplayDistance,'
  1712. ..'NameDisplayDistance,NameOcclusion,Health,MaxHealth,JumpPower,MaxSlopeAngle,PlaybackSpeed,SoundId,Offset,Scale,TextureId,MeshType,Texture,Face,Anchored,Volume,EmitterSize,Looped,MaxDistance,Shape,Locke'
  1713. ..'d;Part,Model,Animation,CharacterMesh,Script,StringValue,NumberValue,BodyColors,Motor6D,Humanoid,Sound,PitchShiftSoundEffect,SpecialMesh,Decal,ReverbSoundEffect;Part|Piggy|Swing|rbxassetid://54584713|T'
  1714. ..'orsoMesh|53846918|53847129|1|AIChase|RightArmMesh|33245711|33247738|3|LeftArmMesh|33245593|2|AnimateSauce|climb|ClimbAnim|http://www.roblox.com/asset/?id=180436334|fall|FallAnim|http://www.roblox.com/'
  1715. ..'asset/?id=180436148|idle|Animation1|http://www.roblox.com/asset/?id=180435571|Weight|9|Animation2|rbxassetid://4677335178|1|jump|JumpAnim|http://www.roblox.com/asset/?id=125750702|run|RunAnim|http://w'
  1716. ..'ww.roblox.com/asset/?id=180426354|sit|SitAnim|http://www.roblox.com/asset/?id=178130996|toolnone|ToolNoneAnim|http://www.roblox.com/asset/?id=182393478|walk|WalkAnim|1,0.5019,0.5921|1,0.349,0.349|Resp'
  1717. ..'awn|Health|HumanoidRootPart|0.6999,2,0,1,1|1568|-10.5398,3.5242,67.6205|0,90,0|2.2884,2.2884,1.1442|0|10|RootJoint|0.1|0,0,0,-1,0,0,0,0,1,0,1,-0|500|60|89.9|Status|AvalibleSpawns|Right Leg|-10.5398,1.'
  1718. ..'2358,67.0484|1.1442,2.2884,1.1442|4|rbxassetid://2254042007|Left Leg|-10.5398,1.2358,68.1926|Right Arm|-10.5398,3.5242,65.9041|0.4156,0.2235,0.0352|-12.2562,2.38,65.9041|0,-90,-90|0.2288,0.2288,3.9819'
  1719. ..'|0|0,0,0.6865|0.0114,0.0114,0.0114|rbxassetid://522117559|rbxassetid://522117587|5|http://www.roblox.com/asset/?id=176678070|qPerfectionWeld|Left Arm|-10.5398,3.5242,69.3368|Torso|-13.1666,2.7805,67.5'
  1720. ..'931|0,180,0|4.1421,5.5609,2.7919|Damage Script|Dead|1.1|rbxassetid://1592934045|5|0.5|http://www.roblox.com/asset/?id=51891030|Neck|0,1.1442,0,-1,0,0,0,0,1,0,1,-0|0,-0.5722,0,-1,0,0,0,0,1,0,1,-0|Left '
  1721. ..'Hip|-1.1443,-1.1443,0,0,0,-1,0,1,0,1,0,0|-0.5722,1.1442,0,0,0,-1,0,1,0,1,0,0|Right Hip|1.1442,-1.1443,0,0,0,1,0,1,-0,-1,0,0|0.5721,1.1442,0,0,0,1,0,1,-0,-1,0,0|Left Shoulder|-1.1443,0.5721,0,0,0,-1,0,'
  1722. ..'1,0,1,0,0|0.5721,0.5721,0,0,0,-1,0,1,0,1,0,0|Right Shoulder|1.1442,0.5721,0,0,0,1,0,1,-0,-1,0,0|-0.5722,0.5721,0,0,0,1,0,1,-0,-1,0,0|Head|-10.5398,5.2406,67.6205|2.2884,1.1442,1.1442|1.25,1.25,1.25|Je'
  1723. ..'ff_Step|rbxassetid://379611235|Jeff_Laugh|rbxassetid://424224932|Jeff_Susto2|rbxassetid://380102473|PeppaPig|25|0.8999|rbxassetid://558157306|2|PEppA|-10.6723,5.7746,67.5868|0,91.97,0|2.9443,2.9443,2.'
  1724. ..'9443|1,0,0|288|-11.6044,6.5924,66.846|0.4008,0.4008,0.4008|0.0666,0.0666,0.0666|-11.4755,6.4963,66.9347|0.6794,0.6794,0.6794|-11.4287,6.4963,68.2928|0.7098,0.3568,0.4196|272|-11.9398,5.9635,67.8572|0,'
  1725. ..'1.97,0|0.9059,0.2264,0.2264|-11.4209,5.9455,68.5191|-10.9682,7.1058,68.5036|67,1.97,0|0.2264,0.9059,0.9059|-11.9413,5.9551,67.6054|0,0.97,0|0.9059,1.3589,1.3589|-11.4833,5.9456,66.7083|-11.9589,5.9512'
  1726. ..',67.304|-11.0307,7.0877,66.6927;0,1>2>59,32>32>31,32>33>48,54>32>48,54>33>59,55>32>48,55>33>39,56>32>48,56>33>36,57>32>48,57>33>47,58>32>48,58>33>42;2|1:2;n;3|1:3|3:4;4|1:5|4:6|5:7|6:8;5;5|1:9;4|1:10|'
  1727. ..'4:11|7:12|6:13;4|1:14|4:15|7:12|6:16;5|1:17;n;6|1:18;n;3|1:19|3:20;p;6|1:21;n;3|1:22|3:23;p;6|1:24;n;3|1:25|3:26;n;7|1:27|8:28;p;3|1:29|3:30;n;7|1:27|8:31;p;p;6|1:32;n;3|1:33|3:34;p;6|1:35;n;3|1:36|3:'
  1728. ..'37;p;6|1:38;n;3|1:39|3:40;p;6|1:41;n;3|1:42|3:43;p;6|1:44;n;3|1:45|3:37;p;p;8|9:46|10:46|11:46|12:46|13:46|14:47;5|1:48;5|1:49;1|1:50|15:51|16:47|17:52|18:31|19:53|20:54|21:55|22:56|23:57|24:57|25:57|'
  1729. ..'26:57|27:57|28:57|16:47|16:47;n;9|1:58|29:59|30:60|31:60;p;10|1:2|34:16|35:56|36:56|37:8|38:61|39:61|40:62|41:63;n;2|1:64;n;2|1:65;p;p;1|1:66|15:51|16:46|17:52|18:31|19:67|20:54|21:68|22:56|23:57|24:5'
  1730. ..'7|25:57|26:57|27:57|28:57|16:46|16:46;n;11|42:69|43:70;n;12;p;p;1|1:71|15:51|16:46|17:52|18:31|19:72|20:54|21:68|22:56|23:57|24:57|25:57|26:57|27:57|28:57|16:46|16:46;n;11|42:69|43:70;n;12;p;p;1|1:73|'
  1731. ..'15:51|16:46|17:52|19:74|20:54|21:68|22:56|23:57|24:57|25:57|26:57|27:57|28:57|16:46|16:46;n;1|16:75|17:52|19:76|20:77|21:78|22:56|24:79|28:79|16:75|16:75;n;13|44:80|45:81|4:82|46:83|47:84;14|48:85|49:'
  1732. ..'16;p;5|1:86;p;1|1:87|15:51|16:46|17:52|19:88|20:54|21:68|22:56|23:57|24:57|25:57|26:57|27:57|28:57|16:46|16:46;1|1:89|15:51|16:47|17:52|19:53|20:54|21:55|22:56|23:57|24:57|25:57|26:57|27:57|28:57|16:4'
  1733. ..'7|16:47;n;1|50:31|16:47|17:52|18:31|19:90|20:91|21:92|22:56|24:79|28:79|16:47|16:47;n;5|1:93;11|1:94|42:95|43:96|51:97;p;5|1:86;14|18:98|48:99;9|1:100|29:59|30:101|31:102;9|1:103|29:59|30:104|31:105;9'
  1734. ..'|1:106|29:59|30:107|31:108;9|1:109|29:59|30:110|31:111;9|1:112|29:59|30:113|31:114;p;1|1:115|15:51|16:46|17:52|18:31|19:116|20:54|21:117|22:56|23:57|24:57|25:57|26:57|27:57|28:57|16:46|16:46;n;13|45:1'
  1735. ..'18;11|1:119|52:56|43:120|51:31;11|1:121|52:56|53:31|43:122|51:31;11|1:123|52:56|43:124|51:31;5|1:86;11|1:125|54:126|53:31|54:126|42:127|43:128|51:129;n;15;p;2|1:2;n;1|1:130|50:31|16:46|17:52|19:131|20'
  1736. ..':132|21:133|55:79|24:79|28:79|16:46|16:46;n;1|50:31|16:134|17:135|19:136|20:132|21:137|55:79|24:79|28:79|16:134|16:134;1|50:31|16:138|17:52|19:139|20:132|21:140|55:79|24:79|28:79|16:138|16:138;1|50:31'
  1737. ..'|16:138|17:52|19:141|20:132|21:140|55:79|24:79|28:79|16:138|16:138;1|50:31|16:142|17:143|19:144|20:145|21:146|55:16|24:79|28:79|16:142|16:142;1|50:31|56:31|16:47|17:52|19:147|20:132|21:140|55:79|24:79'
  1738. ..'|28:79|16:47|16:47;1|50:31|16:46|17:52|19:148|20:149|21:150|55:16|24:79|28:79|16:46|16:46;1|50:31|16:46|17:52|19:151|20:152|21:153|55:16|24:79|28:79|16:46|16:46;1|50:31|16:47|17:52|19:154|20:132|21:14'
  1739. ..'0|55:79|24:79|28:79|16:47|16:47;n;1|50:31|16:142|17:143|19:155|20:145|21:146|55:16|24:79|28:79|16:142|16:142;p;1|50:31|16:46|17:52|19:156|20:145|21:150|55:16|24:79|28:79|16:46|16:46;p;p;p;p;')
  1740. for _,Object in pairs(Objects) do
  1741. Object.Parent = script and script.Parent==workspace and script or workspace
  1742. end
  1743. for _,f in pairs(ActualScripts) do f() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement