Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Script has been loaded ;) Have fun b i t c h.")
- local p = game.Players.LocalPlayer
- local char = p.Character
- local mouse = p:GetMouse()
- local larm = char["Left Arm"]
- local rarm = char["Right Arm"]
- local lleg = char["Left Leg"]
- local rleg = char["Right Leg"]
- local hed = char.Head
- local torso = char.Torso
- local hum = char.Humanoid
- function clerp(c1,c2,al)
- local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
- local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
- for i,v in pairs(com1) do
- com1[i] = v+(com2[i]-v)*al
- end
- return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
- end
- plr = game:service'Players'.LocalPlayer
- char = plr.Character
- mouse = plr:GetMouse()
- humanoid = char:findFirstChild("Humanoid")
- torso = char:findFirstChild("Torso")
- head = char.Head
- ra = char:findFirstChild("Right Arm")
- la = char:findFirstChild("Left Arm")
- rl = char:findFirstChild("Right Leg")
- ll = char:findFirstChild("Left Leg")
- rs = torso:findFirstChild("Right Shoulder")
- ls = torso:findFirstChild("Left Shoulder")
- rh = torso:findFirstChild("Right Hip")
- lh = torso:findFirstChild("Left Hip")
- neck = torso:findFirstChild("Neck")
- rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
- animate = char:findFirstChild("Animate")
- if animate then
- animate:Destroy()
- pls = game:GetService'Players'
- rs = game:GetService'RunService'
- uinps = game:GetService'UserInputService'
- lp = pls.LocalPlayer
- mouse = lp:GetMouse()
- c = lp.Character
- human = c.Humanoid
- human.MaxHealth = 99999999999999999
- soundVol = 0
- wait()
- human.Health = 99999999999999999
- c.Health:Destroy()
- end
- rootpart = char:findFirstChild("HumanoidRootPart")
- camera = workspace.CurrentCamera
- pcall(function() char:findFirstChild('charmodel'):Destroy() char:findFirstChild('SurvivorScript').Disabled = true char:findFirstChild('SurvivorScript'):Destroy() char:findFirstChild'FakeHead':Destroy()
- plr.PlayerGui:findFirstChild'BaseGui':Destroy() end)
- script.Name = 'SurvivorScript'
- charmodel = Instance.new("Model", char)
- charmodel.Name = "charmodel"
- local rm = Instance.new("Motor", torso)
- rm.C0 = CFrame.new(1.5, 0.5, 0)
- rm.C1 = CFrame.new(0, 0.5, 0)
- rm.Part0 = torso
- rm.Part1 = ra
- rm.Name = "Right Shoulder"
- local lm = Instance.new("Motor", torso)
- lm.C0 = CFrame.new(-1.5, 0.5, 0)
- lm.C1 = CFrame.new(0, 0.5, 0)
- lm.Part0 = torso
- lm.Part1 = la
- lm.Name = "Left Shoulder"
- local rlegm = Instance.new("Motor", torso)
- rlegm.C0 = CFrame.new(0.5, -1, 0)
- rlegm.C1 = CFrame.new(0, 1, 0)
- rlegm.Part0 = torso
- rlegm.Part1 = rl
- rlegm.Name = "Right Hip"
- local llegm = Instance.new("Motor", torso)
- llegm.C0 = CFrame.new(-0.5, -1, 0)
- llegm.C1 = CFrame.new(0, 1, 0)
- llegm.Part0 = torso
- llegm.Part1 = ll
- llegm.Name = "Left Hip"
- neck.C0 = CFrame.new(0, 1, 0)
- neck.C1 = CFrame.new(0, -0.5, 0)
- rj.C0 = CFrame.new(0, -1.5, 0)
- rj.C1 = CFrame.new(0, -1.5, 0)
- function LoadChatColorModule()
- local COLOR_TABLE, Get, GetId
- COLOR_TABLE = {
- BrickColor.new("Really black"),
- BrickColor.new("Really black"),
- BrickColor.new("Really black"),
- BrickColor.new("Really black"),
- BrickColor.new("Really black"),
- BrickColor.new("Really black"),
- BrickColor.new("Really black"),
- BrickColor.new("Really black")
- }
- function Get(name)
- return COLOR_TABLE[GetId(name) + 1]
- end
- function GetId(name)
- local length = #name
- local modifier = (length % 2 == 0) and 1 or 0
- local value = 0
- for index = 1, length do
- if (length - index + modifier) % 4 < 2 then
- value = value + string.byte(name, index)
- else
- value = value - string.byte(name, index)
- end
- end
- return value % 8
- end
- return {
- COLOR_TABLE = COLOR_TABLE,
- Get = Get,
- GetId = GetId
- }
- end
- local ChatColor = LoadChatColorModule()
- local PocketColor = BrickColor.new(ChatColor.Get(plr.Name).Name)
- rsc0 = rm.C0
- lsc0 = lm.C0
- neckc0 = neck.C0
- rootc0 = rj.C0
- llc0 = llegm.C0
- rlc0 = rlegm.C0
- speed = 0.25
- angle = 0
- mvmnt = 0
- anglespeed = 1
- humanoid.WalkSpeed = 8
- ctrl = false
- stopsprint = false
- action = false
- sprinting = false
- time_sprinted = 0
- sound_play_time = 0
- local debounce = false
- local knife = false
- local knifeslash = false
- mouse.KeyDown:connect(function(k)
- repeat wait() until action == false
- if not action then
- if k:byte() == 48 then
- sprinting = true
- humanoid.WalkSpeed = 32
- end
- if k == '2' or k == 'c' then
- if not prone then
- ctrl = not ctrl
- if ctrl then
- humanoid.WalkSpeed = 5
- else
- humanoid.WalkSpeed = 8
- end
- end
- end
- if k == "y" then
- flashlight = not flashlight
- if flashlight then
- do
- knife = false
- if charmodel:findFirstChild("Knife") then
- charmodel:findFirstChild("Knife"):Destroy()
- end
- local part = Instance.new("Part", charmodel)
- part.CanCollide = false
- part.FormFactor = 'Custom'
- part.Name = "Flashlight"
- part.Size = Vector3.new(.4, .4, 2.1)
- part:breakJoints()
- local mesh = Instance.new("SpecialMesh", part)
- mesh.TextureId = "rbxassetid://129026436"
- mesh.MeshId = "rbxassetid://87653956"
- mesh.Scale = Vector3.new(.7, .7, .7)
- local weld = Instance.new("Weld", part)
- weld.Part0 = part
- weld.Part1 = ra
- weld.C0 = CFrame.Angles(math.rad(70), 0, -math.rad(10))
- weld.C1 = CFrame.new(-.08, -1.225, .05)
- local point = Instance.new("PointLight", part)
- point.Range = 20
- local spot = Instance.new("SpotLight", part)
- spot.Shadows = true
- spot.Range = 55
- spot.Angle = 60
- spot.Brightness = 30
- end
- else
- if charmodel:findFirstChild("Flashlight") then
- charmodel:findFirstChild("Flashlight"):Destroy()
- end
- end
- end
- if k == "x" then
- ctrl = false
- prone = true
- humanoid.WalkSpeed = 2.5
- end
- if k == "t" then
- knife = not knife
- if knife then
- flashlight = false
- if charmodel:findFirstChild("Flashlight") then
- charmodel:findFirstChild("Flashlight"):Destroy()
- end
- local part = Instance.new("Part", charmodel)
- part.CanCollide = false
- part.FormFactor = 'Custom'
- part.Name = "Knife"
- part.Size = Vector3.new(.2, 1.7, .25)
- part:breakJoints()
- local weld = Instance.new("Weld", part)
- weld.Part0 = part
- weld.Part1 = ra
- weld.C0 = CFrame.Angles(math.pi/2, 0, -math.rad(10))
- weld.C1 = CFrame.new(0, -1, -.45)
- Instance.new("BlockMesh", part).Scale = Vector3.new(.5, 1, .8)
- local part2 = Instance.new("Part", part)
- part2.CanCollide = false
- part2.FormFactor = 'Custom'
- part2.Name = "Knife"
- part2.BrickColor = BrickColor.Black()
- part2.Size = Vector3.new(.3, 1.2, .3)
- part2:breakJoints()
- local weld2 = Instance.new("Weld", part2)
- weld2.Part0 = part2
- weld2.Part1 = part
- weld2.C1 = CFrame.new(0, -.45, 0)
- Instance.new("BlockMesh", part2).Scale = Vector3.new(.5, 1, .8)
- else
- if charmodel:findFirstChild("Knife") then
- charmodel:findFirstChild("Knife"):Destroy()
- end
- end
- end
- end
- end)
- mouse.KeyUp:connect(function(k)
- repeat wait() until action == false
- if not action then
- repeat wait() until action == false
- if k:byte() == 48 then
- sprinting = false
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 10 and hitz and time_sprinted >= .8 then
- time_sprinted = 0
- action = 'StopSprinting'
- end
- humanoid.WalkSpeed = 8
- if ctrl then
- humanoid.WalkSpeed = 5
- end
- if prone then
- humanoid.WalkSpeed = 2.55
- end
- end
- if k == 'x' then
- prone = false
- if ctrl then
- humanoid.WalkSpeed = 5
- else
- humanoid.WalkSpeed = 8
- end
- end
- end
- end)
- mouse.Button1Down:connect(function()
- if knife == true then
- if debounce then return end
- local slashs = Instance.new("Sound", head)
- slashs.SoundId = "rbxasset://sounds/swordslash.mp3"
- slashs.Volume = 1
- slashs.Pitch = 2
- slashs.Name = 'Slash'
- slashs:play()
- debounce = true
- knifeslash = true
- wait(.35)
- if charmodel:findFirstChild('Knife') then
- local killdeb = false
- charmodel:findFirstChild('Knife').Touched:connect(function(hit)
- if knifeslash then
- if killdeb then return end
- if hit and hit.Parent and hit.Parent:findFirstChild("Humanoid") and hit.Parent.Name ~= char.Name then
- killdeb = true
- hit.Parent:findFirstChild("Humanoid"):TakeDamage(math.random(9999999999,9999999999999999))
- local hitsound = Instance.new("Sound", head)
- hitsound.SoundId = "rbxasset://sounds/metal.mp3"
- hitsound.Volume = 1
- hitsound.Name = 'Hit'
- hitsound:play()
- wait(.5)
- hitsound:Destroy()
- slashs:Destroy()
- end
- end
- end)
- end
- knifeslash = false
- wait(.5)
- debounce = false
- end
- end)
- plr.Chatted:connect(function(msg)
- if msg == "/dance" then
- action = 'Dancing'
- end
- if msg == "/point" then
- action = 'Pointing'
- end
- if msg == "/wave" then
- action = 'Waving'
- end
- if msg == "/cheer" then
- action = 'Cheering'
- end
- if msg == "/squat" then
- action = 'Squatting'
- end
- if msg == "/sit" then
- action = 'Sitting'
- end
- end)
- Controls = game:service'ControllerService':children()[1]
- local fakehead = head:clone()
- fakehead.Parent = char
- fakehead.Name = 'FakeHead'
- head.Transparency = 1
- for i,v in pairs(fakehead:children()) do
- if v:IsA'Sound' or v:IsA'Decal' then
- v:Destroy()
- end
- end
- for i,v in pairs(head:children()) do
- if v:IsA'Sound' then
- v:Destroy()
- end
- end
- waitingloop = false
- local fakeweld = Instance.new("Weld", fakehead)
- fakeweld.Part0 = head
- fakeweld.Part1 = fakehead
- humanoid.Jumping:connect(function()
- if not action or not prone then
- action = 'Jumping'
- end
- end)
- local ScreenGui = Instance.new("ScreenGui", plr.PlayerGui)
- ScreenGui.Name = "BaseGui"
- local WhatObject = Instance.new("TextLabel", ScreenGui)
- WhatObject.Size = UDim2.new(0, 50, 0, 10)
- WhatObject.BackgroundColor3 = Color3.new(.25, .25, .25)
- WhatObject.BackgroundTransparency = .45
- WhatObject.TextColor3 = Color3.new(1,1,1)
- WhatObject.TextXAlignment = 'Left'
- WhatObject.Visible = false
- local WhatObjectI = Instance.new("TextLabel", ScreenGui)
- WhatObjectI.Size = UDim2.new(0, 50, 0, 10)
- WhatObjectI.BackgroundColor3 = Color3.new(.05, .05, .05)
- WhatObjectI.TextColor3 = Color3.new(1,1,1)
- WhatObjectI.FontSize = "Size12"
- WhatObjectI.TextYAlignment = 'Top'
- WhatObjectI.TextXAlignment = 'Left'
- WhatObjectI.Visible = false
- WhatObjectI.ZIndex = 3
- local RadioFrame = Instance.new("Frame", ScreenGui)
- RadioFrame.Size = UDim2.new(0, 90, 0, 30)
- RadioFrame.Position = UDim2.new(0, 0, .4, 0)
- RadioFrame.BackgroundColor3 = Color3.new(.25, .25, .25)
- local InventoryBut = Instance.new("TextButton", ScreenGui)
- InventoryBut.Size = UDim2.new(0, 90, 0, 30)
- InventoryBut.Text = 'Inventory'
- InventoryBut.TextColor3 = Color3.new(1,1,1)
- InventoryBut.TextScaled = true
- InventoryBut.Position = UDim2.new(.4, 0, 0, 0)
- InventoryBut.BackgroundColor3 = Color3.new(.25, .25, .25)
- local InventoryGui = Instance.new("Frame", ScreenGui)
- InventoryGui.Size = UDim2.new(.6, 0, .6, 0)
- InventoryGui.BackgroundColor3 = Color3.new(.25, .25, .25)
- InventoryGui.Position = UDim2.new(.2, 0, -1, 0)
- InventoryBut.TouchTap:connect(function()
- InvVisible = not InvVisible
- if InvVisible then
- InventoryGui:TweenPosition(UDim2.new(.2, 0, .2, 0), "Out", "Quad", .35, true)
- elseif not InvVisible then
- InventoryGui:TweenPosition(UDim2.new(.2, 0, -1, 0), "Out", "Quad", .35, true)
- end
- end)
- InventoryBut.MouseButton1Down:connect(function()
- InvVisible = not InvVisible
- if InvVisible then
- InventoryGui:TweenPosition(UDim2.new(.2, 0, .2, 0), "Out", "Quad", .35, true)
- elseif not InvVisible then
- InventoryGui:TweenPosition(UDim2.new(.2, 0, -1, 0), "Out", "Quad", .35, true)
- end
- end)
- Buildings = {}
- local WoodenFence = Instance.new("Part")
- WoodenFence.Size = Vector3.new(10, 5, 1)
- WoodenFence.Anchored = true
- WoodenFence.Material = 'Wood'
- WoodenFence.BrickColor = BrickColor.new'Really red'
- table.insert(Buildings, {WoodenFence = 'Wooden Fence'})
- for y = 1, 4 do
- for x = 1, 4 do
- local slot = Instance.new("ImageLabel", InventoryGui)
- slot.Name = "Slot"..tostring(#InventoryGui:children())
- slot.Size = UDim2.new(.155, 0, .2, 0)
- slot.ZIndex = 2
- slot.Position = UDim2.new(.2+((x-1)/4)*.8, 0, .025+(y-1)/4, 0)
- slot.BackgroundColor3 = Color3.new(.35, .35, .35)
- local stack = Instance.new("TextLabel", slot)
- stack.Size = UDim2.new(0, 0, 0, 25)
- stack.Position = UDim2.new(.95, 0, 1, -25)
- stack.TextXAlignment = 'Right'
- stack.FontSize = "Size12"
- stack.ZIndex = 3
- stack.TextColor3 = Color3.new(1,1,1)
- stack.BackgroundTransparency = 1
- stack.TextStrokeTransparency = .5
- stack.Visible = false
- stack.TextScaled = true
- Instance.new("StringValue", slot).Name = 'ItemName'
- Instance.new("StringValue", slot).Name = 'Description'
- Instance.new("NumberValue", slot).Name = 'Stack'
- Instance.new("BoolValue", slot).Name = 'Functionable'
- Instance.new("StringValue", slot.Functionable).Name = 'Function'
- slot.Functionable.Value = false
- slot.Functionable.Changed:connect(function()
- if slot.Functionable.Function.Value == 'Place' then
- slot.MouseButton1Down:connect(function()
- InvVisible = false
- InventoryGui:TweenPosition(UDim2.new(.2, 0, -1, 0), "Out", "Quad", .35, true)
- local PlaceObject
- for i,v in pairs(Buildings) do
- if v.Name == slot.Name.Value then
- PlaceObject = v:clone()
- PlabeObject.Parent = workspace
- end
- end
- local Placed = false
- mouse.KeyDown:connect(function(k)
- if Placed then return end
- if k == "r" then
- if PlaceObject:IsA'Model' then
- PlabeObject.Dragger:AxisRotate()
- end
- if PlaceObject:IsA'Part' then
- PlaceObject.Rotation = Vector3.new(PlabeObject.Rotation.X, PlabeObject.Rotation.Y+90, PlabeObject.Rotation.Z)
- end
- end
- end)
- mouse.Move:connect(function()
- if Placed then return end
- PlaceObject:TranslateBy(Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z))
- end)
- mouse.Button1Down:connect(function()
- Placed = true
- end)
- end)
- end
- end)
- slot.Stack.Changed:connect(function()
- if slot.Stack.Value == '0' then
- stack.Visible = false
- else
- stack.Visible = true
- stack.Text = slot.Stack.Value
- stack.Size = UDim2.new(0, -stack.TextBounds.x, 0, 25)
- end
- end)
- slot.MouseEnter:connect(function()
- if slot.Description.Value ~= '' then
- WhatObjectI.Parent = slot
- WhatObjectI.Position = UDim2.new(0, 0, 1, 0)
- WhatObjectI.Text = slot.Description.Value
- wait(0)
- WhatObjectI.Size = UDim2.new(0, WhatObjectI.TextBounds.x, 0, WhatObjectI.TextBounds.Y)
- WhatObjectI.Visible = true
- end
- end)
- slot.MouseLeave:connect(function()
- WhatObjectI.Visible = false
- end)
- end
- end
- InventoryGui.Slot1.Image = "rbxassetid://154927249"
- InventoryGui.Slot1.Description.Value = [[A regular flashlight,
- Equip with F.]]
- InventoryGui.Slot2.Image = "rbxassetid://154931868"
- InventoryGui.Slot2.Description.Value = [[It's a survival knife,
- slaughter or gather materials!
- Equip with K.]]
- InventoryGui.Slot3.Description.Value = [[It's wood,
- You can build or use it as material.]]
- InventoryGui.Slot3.Stack.Value = 10
- InventoryGui.Slot3.Image = "rbxassetid://154979500"
- InventoryGui.Slot4.ItemName.Value = "Wooden Fence"
- InventoryGui.Slot4.Description.Value = [[Defending building.]]
- InventoryGui.Slot4.Stack.Value = 1
- InventoryGui.Slot4.Functionable.Function.Value = 'Place'
- radiosound = Instance.new("Sound", head)
- radiosound.Volume = 1
- radiosound.Name = 'IMPOSSIBRU'
- Music = {
- ['1'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://335958739")
- radiosound.SoundId = "rbxassetid://335958739"
- radiosound.Pitch = 1
- end;
- ['2'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://399570826")
- radiosound.SoundId = "rbxassetid://399570826"
- end;
- ['3'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://187324310")
- radiosound.SoundId = "rbxassetid://187324310"
- end;
- ['4'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://164834038")
- radiosound.SoundId = "rbxassetid://164834038"
- end;
- ['5'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://384949210")
- radiosound.SoundId = "rbxassetid://384949210"
- end;
- ['6'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://366789853")
- radiosound.SoundId = "rbxassetid://366789853"
- end;
- ['7'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://338512454")
- radiosound.SoundId = "rbxassetid://338512454"
- end;
- ['8'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://344965733")
- radiosound.SoundId = "rbxassetid://344965733"
- end;
- ['9'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://182621515")
- radiosound.SoundId = "rbxassetid://182621515"
- end;
- ['10'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://186747165")
- radiosound.SoundId = "rbxassetid://186747165"
- radiosound.Pitch = 1
- end;
- ['11'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://171217870")
- radiosound.SoundId = "rbxassetid://171217870"
- radiosound.Pitch = 1
- end;
- ['12'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://163722380")
- radiosound.SoundId = "rbxassetid://163722380"
- end;
- ['13'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://338228788")
- radiosound.SoundId = "rbxassetid://338228788"
- end;
- ['14'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://156105878")
- radiosound.SoundId = "rbxassetid://156105878"
- end;
- ['15'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://322616696")
- radiosound.SoundId = "rbxassetid://322616696"
- end;
- ['16'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://272467655")
- radiosound.SoundId = "rbxassetid://272467655"
- end;
- ['17'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://197769965")
- radiosound.SoundId = "rbxassetid://197769965"
- end;
- ['18'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://257768376")
- radiosound.SoundId = "rbxassetid://257768376"
- end;
- ['19'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://142300879")
- radiosound.SoundId = "rbxassetid://142300879"
- end;
- ['20'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://300143023")
- radiosound.SoundId = "rbxassetid://300143023"
- end;
- ['21'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://174212113")
- radiosound.SoundId = "rbxassetid://174212113"
- end;
- ['22'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://185320433")
- radiosound.SoundId = "rbxassetid://185320433"
- end;
- ['23'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://218299512")
- radiosound.SoundId = "rbxassetid://218299512"
- end;
- ['24'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://280971159")
- radiosound.SoundId = "rbxassetid://280971159"
- end;
- ['25'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://263504315")
- radiosound.SoundId = "rbxassetid://263504315"
- end;
- ['26'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://198249011")
- radiosound.SoundId = "rbxassetid://198249011"
- end;
- ['27'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://239902092")
- radiosound.SoundId = "rbxassetid://239902092"
- end;
- ['28'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://241148012")
- radiosound.SoundId = "rbxassetid://241148012"
- end;
- ['29'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://158353213")
- radiosound.SoundId = "rbxassetid://158353213"
- end;
- ['30'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://201129564")
- radiosound.SoundId = "rbxassetid://201129564"
- end;
- ['31'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://181663037")
- radiosound.SoundId = "rbxassetid://181663037"
- radiosound.Pitch = 1
- end;
- ['32'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://150488830")
- radiosound.SoundId = "rbxassetid://150488830"
- radiosound.Pitch = 1
- end;
- ['33'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://165295816")
- radiosound.SoundId = "rbxassetid://165295816"
- end;
- ['34'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://143003257")
- radiosound.SoundId = "rbxassetid://143003257"
- end;
- ['35'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://237265076")
- radiosound.SoundId = "rbxassetid://237265076"
- end;
- ['36'] = function(plr)
- game:service'ContentProvider':Preload("rbxassetid://146626271")
- radiosound.SoundId = "rbxassetid://146626271"
- end;
- }
- local HowMuchMusic = 0
- for _,_ in pairs(Music) do
- HowMuchMusic = HowMuchMusic + 1
- end
- RadioEnabled = false
- local song
- local current = 1
- local CurrentNumber = Instance.new("TextLabel", RadioFrame)
- CurrentNumber.Size = UDim2.new(0, 60, 0, 15)
- CurrentNumber.Position = UDim2.new(0, 0, 0, -15)
- CurrentNumber.TextColor3 = Color3.new(1,1,1)
- CurrentNumber.BackgroundTransparency = 1
- CurrentNumber.Text = tostring(current).."/"..HowMuchMusic
- CurrentNumber.TextScaled = true
- local OnOff = Instance.new("TextButton", RadioFrame)
- OnOff.Size = UDim2.new(0, 60, 0, 28)
- OnOff.Position = UDim2.new(0, 1, 0, 1)
- OnOff.TextColor3 = Color3.new(1,1,1)
- OnOff.BackgroundColor3 = Color3.new(.6, 0, 0)
- OnOff.Text = 'OFF'
- OnOff.TextScaled = true
- function nextSong(current2)
- local CurrentSong = current2
- coroutine.wrap(function()
- for i = 1, 121 do
- if RadioEnabled and CurrentSong == current2 then
- wait(1)
- else return end
- end
- if RadioEnabled and CurrentSong == current then
- radiosound:stop()
- current = current + 1
- if current > HowMuchMusic then
- current = 1
- end
- for index,func in pairs(Music) do
- if index == tostring(current) then
- func(plr)
- end
- end
- CurrentNumber.Text = tostring(current).."/"..HowMuchMusic
- radiosound:play()
- nextSong(current)
- end
- end)()
- end
- OnOff.MouseButton1Down:connect(function()
- RadioEnabled = not RadioEnabled
- if RadioEnabled then
- OnOff.BackgroundColor3 = Color3.new(0, .6, 0)
- OnOff.Text = 'ON'
- song = Music[tostring(current)]
- for index,func in pairs(Music) do
- if index == tostring(current) then
- func(plr)
- end
- end
- radiosound:play()
- nextSong(current)
- elseif not RadioEnabled then
- OnOff.BackgroundColor3 = Color3.new(.6, 0, 0)
- OnOff.Text = 'OFF'
- radiosound:pause()
- end
- end)
- OnOff.TouchTap:connect(function()
- RadioEnabled = not RadioEnabled
- if RadioEnabled then
- OnOff.BackgroundColor3 = Color3.new(0, .6, 0)
- OnOff.Text = 'ON'
- song = Music[tostring(current)]
- for index,func in pairs(Music) do
- if index == tostring(current) then
- func(plr)
- end
- end
- radiosound:play()
- CurrentNumber.Text = tostring(current).."/"..HowMuchMusic
- radiosound:play()
- nextSong(current)
- elseif not RadioEnabled then
- OnOff.BackgroundColor3 = Color3.new(.6, 0, 0)
- OnOff.Text = 'OFF'
- radiosound:pause()
- end
- end)
- local Next = Instance.new("TextButton", RadioFrame)
- Next.Size = UDim2.new(0, 28, 0, 28)
- Next.Position = UDim2.new(0, 61, 0, 1)
- Next.TextColor3 = Color3.new(1,1,1)
- Next.BackgroundTransparency = 1
- Next.Text = '>'
- Next.MouseButton1Down:connect(function()
- radiosound:stop()
- radiosound:stop()
- current = current + 1
- if current > HowMuchMusic then
- current = 1
- end
- CurrentNumber.Text = tostring(current).."/"..HowMuchMusic
- song = Music[tostring(current)]
- for index,func in pairs(Music) do
- if index == tostring(current) then
- func(plr)
- end
- end
- if RadioEnabled then
- radiosound:play()
- end
- end)
- humanoid.Changed:connect(function(changed)
- --[[if ctrl and changed == 'Jump' then
- humanoid.Jump = false
- action = 'Rolling'
- end--]]
- if action ~= false or prone then
- humanoid.Jump = false
- end
- end)
- humanoid.Climbing:connect(function(speed)
- if speed > 4 then
- action = 'Climbing'
- humanoid.WalkSpeed = 8
- else
- action = false
- if ctrl then
- humanoid.WalkSpeed = 5
- elseif prone then
- humanoid.WalkSpeed = 2.5
- end
- end
- end)
- mouse.Move:connect(function()
- if (mouse.Target ~= nil and mouse.Target:IsA('Part') and mouse.Target.Parent and mouse.Target.Parent:IsA('Model') and mouse.Target.Parent:findFirstChild'Humanoid') or (mouse.Target ~= nil and mouse.Target:IsA('Part') and mouse.Target.Parent and mouse.Target.Parent:IsA'Hat' and mouse.Target.Parent.Parent and mouse.Target.Parent.Parent:findFirstChild'Humanoid') then
- local target = mouse.Target
- WhatObject.Visible = true
- if target.Parent:IsA'Model' then
- WhatObject.Text = target.Parent.Name
- elseif target.Parent:IsA'Hat' then
- WhatObject.Text = target.Parent.Parent.Name
- end
- WhatObject.Size = UDim2.new(0, WhatObject.TextBounds.x, 0, 10)
- WhatObject.Position = UDim2.new(0, mouse.X + 10, 0, mouse.Y - 15)
- else
- WhatObject.Visible = false
- end
- end)
- wait()
- local sound = Instance.new("Sound", head)
- sound.Volume = .65
- game:service'RunService'.Stepped:connect(function()
- if prone or ctrl then
- rootpart.CanCollide = false
- end
- end)
- idling = 0
- dancingtime = 0
- game:service'RunService'.RenderStepped:connect(function()
- if charmodel.Parent ~= char then charmodel.Parent = char end
- if fakehead.Parent ~= char then fakehead.Parent = char end
- if not loopedaction then
- local rscf = rsc0
- local lscf = lsc0
- local rlcf = rlc0
- local llcf = llc0
- local rjcf = rootc0
- local ncf = neckc0
- local rayz = Ray.new(rootpart.Position, Vector3.new(0, -4.1, 0))
- local hitz, enz = workspace:findPartOnRay(rayz, char)
- angle = (angle % 100) + anglespeed/10
- mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
- for i,object in pairs(char:children()) do
- if object:IsA("Tool") then
- if not wldunknown then
- wldunknown = Instance.new("Weld", rarm)
- wldunknown.Name = "RightGrip"
- wldunknown.Part0 = rarm
- if object:findFirstChild("Handle") then
- wldunknown.Part1 = object:findFirstChild("Handle")
- end
- end
- tool = true
- elseif not object:IsA("Tool") then
- if tool then
- pcall(function()
- wldunknown:Destroy()
- wldunknown:Destroy()
- end)
- end
- tool = false
- end
- end
- if action ~= false then
- idling = 0
- if action == 'StopSprinting' then
- Controls.Parent = nil
- speed = 0.15
- local bodyvelocity = Instance.new("BodyVelocity", rootpart)
- bodyvelocity.maxForce = Vector3.new(1/0,0,1/0)
- bodyvelocity.velocity = rootpart.CFrame.lookVector * 16
- ncf = neckc0 * CFrame.Angles(math.rad(-12), -math.rad(15), 0)
- rscf = rsc0 * CFrame.Angles(math.rad(-21), 0, math.rad(4.5))
- lscf = lsc0 * CFrame.Angles(math.rad(-23.5), 0, -math.rad(3.5))
- rjcf = rootc0 * CFrame.new(0, -.35, 0) * CFrame.Angles(math.rad(15), math.rad(25), 0)
- llcf = llc0 * CFrame.new(0, .15, -.25) * CFrame.Angles(-math.rad(30), 0, -math.rad(5.5))
- rlcf = rlcf * CFrame.new(0, .05, -.15) * CFrame.Angles(math.rad(20), 0, math.rad(2))
- loopedaction = true
- for i = 0, 25 do
- bodyvelocity.velocity = rootpart.CFrame.lookVector * (16 - i/1.5)
- rm.C0 = clerp(rm.C0,rscf,speed)
- lm.C0 = clerp(lm.C0,lscf,speed)
- rj.C0 = clerp(rj.C0,rjcf,speed)
- rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
- llegm.C0 = clerp(llegm.C0,llcf,speed)
- neck.C0 = clerp(neck.C0,ncf,speed)
- wait()
- end
- bodyvelocity:Destroy()
- loopedaction = false
- stopsprint = false
- action = false
- Controls.Parent = game:service'ControllerService'
- humanoid.WalkSpeed = 8
- if ctrl then
- humanoid.WalkSpeed = 5
- elseif prone then
- humanoid.WalkSpeed = 2.5
- end
- end
- if action == "Climbing" then
- anglespeed = 2
- speed = 0.1
- ncf = neckc0 * CFrame.Angles(math.pi/3, 0, 0)
- rjcf = rootc0
- rscf = rsc0 * CFrame.new(0, -0.2 + -mvmnt*0.2, 0.45) * CFrame.Angles(math.pi/1.5, 0, -math.abs(mvmnt)*0.025)
- lscf = lsc0 * CFrame.new(0, -0.2 + mvmnt*0.2, 0.45) * CFrame.Angles(math.pi/1.5, 0, math.abs(mvmnt)*0.025)
- rlcf = rlc0 * CFrame.new(0, 0.3 + mvmnt*0.2, 0) * CFrame.Angles(math.pi/14, 0, 0)
- llcf = llc0 * CFrame.new(0, 0.3 + -mvmnt*0.2, 0) * CFrame.Angles(math.pi/14, 0, 0)
- end
- if action == 'Jumping' then
- if not prone or ctrl then
- loopedaction = true
- ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
- rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
- rscf = rsc0 * CFrame.Angles(-math.pi/16, -math.sin(angle)*0.08, 0)
- lscf = lsc0 * CFrame.Angles(-math.pi/17, math.sin(angle)*0.08, 0)
- rlcf = rlc0 * CFrame.new(0, .45, -.45) * CFrame.Angles(-math.pi/16+-math.sin(angle)*0.125, -math.sin(angle)*0.08, math.rad(2.5))
- llcf = llc0 * CFrame.Angles(-math.pi/17+-math.sin(angle)*0.125, math.sin(angle)*0.08, -math.rad(2.5))
- for i = 0, 12 do
- rm.C0 = clerp(rm.C0,rscf,speed)
- lm.C0 = clerp(lm.C0,lscf,speed)
- rj.C0 = clerp(rj.C0,rjcf,speed)
- rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
- llegm.C0 = clerp(llegm.C0,llcf,speed)
- neck.C0 = clerp(neck.C0,ncf,speed)
- wait()
- end
- end
- loopedaction = false
- action = false
- end
- if action == 'Pointing' then
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
- anglespeed = .5
- speed = 0.25
- ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.007, 0, 0)
- rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.0015, 0, 0)
- rscf = rsc0 * CFrame.Angles(math.pi/2, -math.sin(angle)*0.008, 0)
- lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.008, 0)
- rlcf = rlc0 * CFrame.Angles(-math.sin(angle)*0.0015, -math.sin(angle)*0.008, math.rad(2.5))
- llcf = llc0 * CFrame.Angles(-math.sin(angle)*0.0015, math.sin(angle)*0.008, -math.rad(2.5))
- else
- action = false
- end
- end
- if action == 'Waving' then
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
- anglespeed = .5
- speed = 0.25
- ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.007, 0, 0)
- rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.0025, 0, 0)
- rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.008, math.pi/1.4+math.sin(angle)*.5)
- lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.008, 0)
- rlcf = rlc0 * CFrame.Angles(-math.sin(angle)*0.0025, -math.sin(angle)*0.008, math.rad(2.5))
- llcf = llc0 * CFrame.Angles(-math.sin(angle)*0.0025, math.sin(angle)*0.008, -math.rad(2.5))
- else
- action = false
- end
- end
- if action == 'Cheering' then
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
- anglespeed = 2
- speed = 0.25
- ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
- rjcf = rootc0 * CFrame.new(0, math.abs(math.sin(angle)), 0)
- rscf = rsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.25, 0, math.rad(2))
- lscf = lsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.25, 0, -math.rad(2))
- rlcf = rlc0 * CFrame.Angles(0, 0, math.rad(5))
- llcf = llc0 * CFrame.Angles(0, 0, -math.rad(5))
- else
- action = false
- end
- end
- if action == 'Rolling' then
- loopedaction = true
- anglespeed = 2
- speed = 0.6
- Controls.Parent = nil
- local bodyvelocity = Instance.new("BodyVelocity", rootpart)
- bodyvelocity.maxForce = Vector3.new(1/0,1/0,1/0)
- bodyvelocity.velocity = rootpart.CFrame.lookVector * 10
- rj.C1 = CFrame.new()
- for roll = 0, 360, 2 do
- ncf = neckc0 * CFrame.Angles(-math.pi/1.85, 0, 0)
- rjcf = CFrame.new() * CFrame.new(0, -1, 0) * CFrame.Angles(-math.rad(roll), 0, 0)
- rscf = rsc0 * CFrame.Angles(math.pi/2.5, 0, -math.rad(30))
- lscf = lsc0 * CFrame.Angles(math.pi/2.5, 0, math.rad(30))
- rlcf = rlc0 * CFrame.new(0, .6, -.75) * CFrame.Angles(-math.pi/2.5, 0, 0)
- llcf = llc0 * CFrame.new(0, .6, -.75) * CFrame.Angles(-math.pi/2.5, 0, 0)
- rm.C0 = clerp(rm.C0,rscf,speed)
- lm.C0 = clerp(lm.C0,lscf,speed)
- rj.C0 = clerp(rj.C0,rjcf,speed)
- neck.C0 = clerp(neck.C0,ncf,speed)
- rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
- llegm.C0 = clerp(llegm.C0,llcf,speed)
- wait()
- end
- rj.C0 = CFrame.new(0, -1.5, 0)
- rj.C1 = CFrame.new(0, -1.5, 0)
- bodyvelocity:Destroy()
- action = false
- Controls.Parent = game:service'ControllerService'
- loopedaction = false
- end
- if action == 'Dancing' then
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
- dancingtime = dancingtime + 1/60
- anglespeed = 1
- speed = 0.25
- if dancingtime <= 12 then
- ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
- rjcf = rootc0 * CFrame.new(0, 0.75 + -math.abs(math.sin(angle)), 0) * CFrame.Angles(0, 0, math.sin(angle)*.1)
- rscf = rsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.5, 0, math.rad(2))
- lscf = lsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.5, 0, -math.rad(2))
- rlcf = rlc0 * CFrame.Angles(math.sin(angle)*.25, 0, math.rad(5))
- llcf = llc0 * CFrame.Angles(-math.sin(angle)*.25, 0, -math.rad(5))
- elseif dancingtime <= 22 then
- ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
- rjcf = rootc0 * CFrame.new(0, math.abs(math.cos(angle)*.05), 0) * CFrame.Angles(0, math.sin(angle)*.035, math.sin(angle)*.015)
- rscf = rsc0 * CFrame.Angles(math.pi/2-math.abs(math.sin(angle))*.5, 0, math.rad(2))
- lscf = lsc0 * CFrame.Angles(math.pi/2-math.abs(math.sin(angle))*.5, 0, -math.rad(2))
- rlcf = rlc0 * CFrame.Angles(math.sin(angle)*.05, 0, math.rad(5))
- llcf = llc0 * CFrame.Angles(-math.sin(angle)*.05, 0, -math.rad(5))
- elseif dancingtime >= 22 then
- dancingtime = 0
- end
- else
- action = false
- end
- end
- if action == 'Squatting' then
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
- anglespeed = 0.15
- speed = 0.25
- ncf = neckc0 * CFrame.Angles(math.pi/12-math.sin(angle)*0.005,0,0)
- rscf = rsc0 * CFrame.new(-.35, 0, -.35+math.sin(angle)*0.005) * CFrame.Angles(math.pi/2.2+math.sin(-angle)*.005, 0, -math.pi/4.5)
- lscf = lsc0 * CFrame.new(.35, 0, -.35+math.sin(angle)*0.005) * CFrame.Angles(math.pi/2.2+math.sin(angle)*.005, 0, math.pi/4.5)
- rjcf = rootc0 * CFrame.new(0, -.9, .55) * CFrame.Angles(-math.pi/12+math.sin(angle)*0.005, 0, 0)
- llcf = llc0 * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/12, 0, -math.rad(2))
- rlcf = rlcf * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/14, 0, math.rad(2))
- else
- action = false
- end
- end
- if action == 'Sitting' then
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
- anglespeed = 0.15
- speed = 0.15
- ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.005,0,0)
- rscf = rsc0 * CFrame.Angles(-math.pi/16, 0, math.pi/24)
- lscf = lsc0 * CFrame.Angles(-math.pi/16, 0, -math.pi/24)
- rjcf = rootc0 * CFrame.new(0, -1.9, 0) * CFrame.Angles(math.pi/16+math.sin(angle)*0.005, 0, 0)
- llcf = llc0 * CFrame.new(0, .95, -.75) * CFrame.Angles(math.pi/5, 0, -math.rad(7))
- rlcf = rlcf * CFrame.new(0, .95, -.75) * CFrame.Angles(math.pi/5, 0, math.rad(7))
- else
- action = false
- end
- end
- end
- if hitz and hitz.Material == Enum.Material.Grass or hitz and hitz.Material == Enum.Material.Fabric or hitz and hitz.Material == Enum.Material.Pebble or hitz and hitz.Material == Enum.Material.Sand then
- sound.SoundId = "rbxasset://sounds/grass2.mp3"
- elseif hitz and hitz.Material == Enum.Material.Plastic or hitz and hitz.Material == Enum.Material.SmoothPlastic then
- sound.SoundId = "rbxasset://sounds/plasticplastic.mp3"
- elseif hitz and hitz.Material == Enum.Material.Brick or hitz and hitz.Material == Enum.Material.Slate or hitz and hitz.Material == Enum.Material.Granite or hitz and hitz.Material == Enum.Material.Concrete or hitz and hitz.Material == Enum.Material.Marble then
- sound.SoundId = "rbxasset://sounds/stone.mp3"
- elseif hitz and hitz.Material == Enum.Material.Ice then
- sound.SoundId = "rbxasset://sounds/ice2.mp3"
- elseif hitz and hitz.Material == Enum.Material.CorrodedMetal or hitz and hitz.Material == Enum.Material.DiamondPlate then
- sound.SoundId = "rbxasset://sounds/metal3.mp3"
- elseif hitz and hitz.Material == Enum.Material.Wood then
- sound.SoundId = "rbxasset://sounds/woodwood.mp3"
- end
- if not action then
- if humanoid.Sit then
- ncf = neckc0 * CFrame.Angles(0, 0, 0)
- rjcf = rootc0 * CFrame.new(0, -.5, 0) * CFrame.Angles(math.rad(10), 0, 0)
- rscf = rsc0 * CFrame.Angles(-math.rad(10), 0, math.rad(5))
- lscf = lsc0 * CFrame.Angles(-math.rad(10), 0, -math.rad(5))
- rlcf = rlc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2-math.rad(10), 0, math.rad(5.5))
- llcf = llc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2-math.rad(10), 0, -math.rad(5.5))
- elseif not hitz and torso.Velocity.y <= -0.5 then
- anglespeed = 1
- if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 15 then
- if not waitingloop then
- waitingloop = true
- coroutine.wrap(function()
- repeat wait() until hitz
- action = 'StopSprinting'
- end)()
- end
- end
- anglespeed = 3
- local VelY = torso.Velocity.Y
- if VelY <= -85 then VelY = -85 end
- ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
- rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
- rscf = rsc0 * CFrame.Angles(-math.rad(VelY)-math.sin(angle)*0.48, 0, math.rad(15.5+math.random(-1,3)))
- lscf = lsc0 * CFrame.Angles(-math.rad(VelY)+math.sin(angle)*0.48, 0, -math.rad(15.5+math.random(1,3)))
- rlcf = rlc0 * CFrame.Angles(-math.pi/16+-math.sin(angle)*0.35, -math.sin(angle)*0.008, math.rad(2.5))
- llcf = llc0 * CFrame.Angles(-math.pi/17+math.sin(angle)*0.35, math.sin(angle)*0.008, math.rad(-2.5))
- elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
- sound_play_time = 0
- if stopsprint and time_sprinted >= .8 then
- time_sprinted = 0
- action = 'StopSprinting'
- end
- time_sprinted = 0
- anglespeed = 0.15
- if prone then
- speed = 0.1
- ncf = neckc0 * CFrame.Angles(math.pi/2.1, 0, 0)
- rscf = rsc0 * CFrame.Angles(math.pi/.2-math.rad(10), -math.sin(angle)*0.02, 0)
- lscf = lsc0 * CFrame.Angles(math.pi/.2-math.rad(10), math.sin(angle)*0.02, 0)
- rjcf = rootc0 * CFrame.new(0, -.95, 0) * CFrame.Angles(-math.pi/2, 0, 0)
- llcf = llc0 * CFrame.new(0, 0, -.15) * CFrame.Angles(0, 0, math.rad(-5))
- rlcf = rlcf * CFrame.new(0, 0, -.15) * CFrame.Angles(0, 0, math.rad(5))
- elseif ctrl then
- speed = 0.15
- ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
- rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.08, math.pi/18)
- lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.08, -math.pi/18)
- rjcf = rootc0 * CFrame.new(0, -1.25, 0)
- llcf = llc0 * CFrame.new(0, 0, -.4999) * CFrame.Angles(-math.pi/2.2, 0, 0)
- rlcf = rlcf * CFrame.new(0, 1.25, -.85)
- elseif not ctrl and not prone then
- speed = 0.15
- idling = idling + 1/20
- if idling >= 20 then
- ncf = neckc0 * CFrame.Angles(math.pi/12-math.sin(angle)*0.005,0,0)
- rscf = rsc0 * CFrame.new(-.35, 0, -.35+math.sin(angle)*0.005) * CFrame.Angles(math.pi/2.2+math.sin(-angle)*.005, 0, -math.pi/4.5)
- lscf = lsc0 * CFrame.new(.35, 0, -.35+math.sin(angle)*0.005) * CFrame.Angles(math.pi/2.2+math.sin(angle)*.005, 0, math.pi/4.5)
- rjcf = rootc0 * CFrame.new(0, -.9, .55) * CFrame.Angles(-math.pi/12+math.sin(angle)*0.005, 0, 0)
- llcf = llc0 * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/12, 0, -math.rad(2))
- rlcf = rlcf * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/14, 0, math.rad(2))
- else
- ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
- rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
- rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.08, 0)
- lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.08, 0)
- rlcf = rlc0 * CFrame.Angles(-math.sin(angle)*0.025, -math.sin(angle)*0.08, math.rad(2.5))
- llcf = llc0 * CFrame.Angles(-math.sin(angle)*0.025, math.sin(angle)*0.08, -math.rad(2.5))
- end
- end
- elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 10 then
- if stopsprint and time_sprinted >= .8 then
- action = 'StopSprinting'
- end
- sound_play_time = sound_play_time + 1/60
- time_sprinted = 0
- idling = 0
- anglespeed = 1.5
- if prone then
- speed = 0.1
- anglespeed = .85
- ncf = neckc0 * CFrame.Angles(math.pi/2.1, 0, 0)
- rscf = rsc0 * CFrame.new(0, .7+ math.sin(angle)*.35, .1 + math.cos(-angle)*.1) * CFrame.Angles(math.pi/.2-math.rad(10), -math.sin(angle)*0.02, -math.pi/8)
- lscf = lsc0 * CFrame.new(0, .7+ -math.sin(angle)*.35, .1 - math.cos(angle)*.1) * CFrame.Angles(math.pi/.2-math.rad(10), math.sin(angle)*0.02, math.pi/8)
- rjcf = rootc0 * CFrame.new(0, -.95, 0) * CFrame.Angles(-math.pi/2, 0, 0)
- llcf = llc0 * CFrame.new(0, .35 + -math.sin(angle)*.35, 0) * CFrame.new(0, 0, -.15) * CFrame.Angles(0, 0, math.rad(-5))
- rlcf = rlcf * CFrame.new(0, .35 + math.sin(angle)*.35, 0) * CFrame.new(0, 0, -.15) * CFrame.Angles(0, 0, math.rad(5))
- elseif ctrl then
- speed = 0.25
- if sound_play_time >= .4 then
- sound.Volume = .45
- sound:play()
- sound_play_time = 0
- end
- ncf = neckc0 * CFrame.Angles(math.pi/12,0,0)
- rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.025) * CFrame.Angles(math.pi/24+math.sin(-angle)*.05, 0, math.pi/18-math.abs(mvmnt)*0.02)
- lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.025) * CFrame.Angles(math.pi/24+math.sin(angle)*.05, 0, -math.pi/18+math.abs(mvmnt)*0.02)
- rjcf = rootc0 * CFrame.new(0, -.7, 0) * CFrame.Angles(math.abs(math.sin(angle))*0.025 + -math.pi/12, 0, 0)
- llcf = llc0 * CFrame.new(0, .85 + .2 - math.cos(angle)*.2, -.5 + (-.4+math.sin(angle)*0.25)) * CFrame.Angles(math.pi/18 + -math.pi/10 - math.sin(angle)*.45, 0, 0)
- rlcf = rlcf * CFrame.new(0, .85 + .2 + math.cos(angle)*.2, -.5 + (-.25-math.sin(angle)*0.25)) * CFrame.Angles(math.pi/18 + -math.pi/10 + math.sin(angle)*.45, 0, 0)
- elseif not ctrl and not prone then
- speed = 0.25
- if sound_play_time >= .4 then
- sound.Volume = .65
- sound:play()
- sound_play_time = 0
- end
- rjcf = rootc0 * CFrame.Angles(math.abs(math.sin(angle))*0.025 + -math.pi/64, 0, 0)
- rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(angle)*.5, 0, -math.abs(mvmnt)*0.02)
- lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(-angle)*.5, 0, math.abs(mvmnt)*0.02)
- rlcf = rlc0 * CFrame.new(0, .075 + -math.cos(-angle)*.075, -.05+math.sin(angle)*0.1) * CFrame.Angles(math.sin(-angle)*.45, 0, math.rad(.5))
- llcf = llc0 * CFrame.new(0, .075 - -math.cos(angle)*.075, -.05-math.sin(angle)*0.1) * CFrame.Angles(math.sin(angle)*.45, 0, -math.rad(.5))
- end
- elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 15 then
- idling = 0
- time_sprinted = time_sprinted + 1/60
- sound_play_time = sound_play_time + 1/60
- stopsprint = true --when released
- anglespeed = 2
- speed = .3
- if sound_play_time >= .375 then
- sound.Volume = .75
- sound:play()
- sound_play_time = 0
- end
- local RotVelocityZ = torso.RotVelocity.Y
- if RotVelocityZ >= 15 then
- RotVelocityZ = 15
- elseif RotVelocityZ <= -15 then
- RotVelocityZ = -15
- end
- ncf = neckc0 * CFrame.Angles(0, -math.sin(angle)*.1, 0)
- rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(angle)*1.1, 0, -math.abs(mvmnt)*0.02)
- lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(-angle)*1.1, 0, math.abs(mvmnt)*0.02)
- rjcf = rootc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.abs(math.sin(angle))*0.055 + -math.pi/18, math.sin(angle)*.1, math.sin(angle)*.045 + math.rad(RotVelocityZ)*2.5)
- rlcf = rlc0 * CFrame.new(0, .3 + -math.cos(-angle)*.3, -.2+math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
- llcf = llc0 * CFrame.new(0, .3 - -math.cos(angle)*.3, -.05-math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
- --rlcf -.2+math.sin(angle)*0.25
- --llcf -.05-math.sin(angle)*0.25
- end
- end
- if knife then
- if prone then
- rscf = rsc0 * CFrame.Angles(math.rad(170), -math.rad(10), -.2)
- else
- rscf = rsc0 * CFrame.Angles(math.rad(50), -math.rad(10), -.2)
- end
- elseif flashlight then
- if prone then
- rscf = rsc0 * CFrame.Angles(math.rad(170), -math.rad(10), -.2)
- else
- rscf = rsc0 * CFrame.Angles(math.rad(70), -math.rad(10), -.2)
- end
- end
- if knifeslash then
- if prone then
- rscf = rsc0 * CFrame.Angles(math.rad(190), -math.rad(10), -.2)
- else
- rscf = rsc0 * CFrame.Angles(math.rad(100), -math.rad(10), -.2)
- end
- end
- rm.C0 = clerp(rm.C0,rscf,speed)
- lm.C0 = clerp(lm.C0,lscf,speed)
- rj.C0 = clerp(rj.C0,rjcf,speed)
- rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
- llegm.C0 = clerp(llegm.C0,llcf,speed)
- neck.C0 = clerp(neck.C0,ncf,speed)
- end
- end)
- hed.face.Texture = "rbxassetid://411170797"
- --Credits Eurse
- local v=Vector3.new
- local yield=coroutine.yield
- local uvec=Vector3.new(1, 1, 1)
- local inf=math.huge
- local infvec=uvec*inf
- local down=false
- local speed;
- local players=game:GetService"Players"
- local player=players.LocalPlayer
- local mouse=player:GetMouse()
- repeat yield() until player.Character
- local character=player.Character
- local torso=character:WaitForChild"Torso"
- local humanoid=character:WaitForChild"Humanoid"
- function weld(p1, p2)
- local weld=Instance.new"Weld"
- weld.Parent=p1
- weld.Part0=p1
- weld.Part1=p2
- return weld
- end
- local ball=Instance.new"Part"
- ball.CanCollide=false
- ball.TopSurface="Smooth"
- ball.BottomSurface="Smooth"
- ball.BrickColor=BrickColor.new"Pastel brown"
- ball.FormFactor="Custom"
- Instance.new("SpecialMesh", ball).MeshType=Enum.MeshType.Sphere
- local lb=ball:Clone()
- lb.Size=uvec*1.1
- lb.Parent=character
- local lbn=ball:clone()
- lbn.BrickColor=BrickColor.new"Medium red"
- lbn.Size=uvec*.2
- lbn.Parent=character
- local rb=lb:Clone()
- rb.Parent=character
- local rbn=lbn:Clone()
- rbn.Parent=character
- local lbnw=weld(lb, lbn)
- local rbnw=weld(rb, rbn)
- lbnw.C0=CFrame.new(0, 0, -(lb.Size.X/2-lbn.Size.X/4))
- rbnw.C0=lbnw.C0
- local lbw=weld(torso, lb)
- local rbw=weld(torso, rb)
- lbw.C0=CFrame.new(-lb.Size.X/2, lb.Size.X/2, -lb.Size.X/2)
- rbw.C0=lbw.C0*CFrame.new(lb.Size.X, 0, 0)
- while true do
- local dt=yield()
- local v=torso.Velocity
- local c0=CFrame.new(-lb.Size.X/2, lb.Size.X/2, -lb.Size.X/2)
- local deg=-math.max(math.min(v.Y*1.8, 50), -50)/70
- --print(deg)
- local ang=CFrame.Angles(deg * math.pi/2 , 0, 0)
- lbw.C0=c0*CFrame.Angles(0, deg*1.2*math.pi/4, 0)*ang
- rbw.C0=c0*CFrame.new(lb.Size.X, 0, 0)*CFrame.Angles(0, -deg*1.2*math.pi/4, 0)*ang
- end
- pairs(chr:GetChildren()) do if v:IsA("Shirt") then v:Destroy() end end
- local isScriptNil = false
- local PlrName = "hotboybilly"
- local Plrs = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local Content = game:GetService("ContentProvider")
- local LP = Plrs.LocalPlayer
- local Char = LP.Character
- local PlrGui = LP.PlayerGui
- local Backpack = LP.Backpack
- local Mouse = LP:GetMouse()
- local Camera = Workspace.CurrentCamera
- local LastCamCF = Camera.CoordinateFrame
- local AnimJoints = {}
- local Cons = {}
- local mDown = false
- local Multi = false
- local Grabbing = false
- local Current = {}
- local Alpha = 1
- local LightNum = 1
- Current.Part = nil
- Current.BP = nil
- Current.BA = nil
- Current.Mass = nil
- local LastPart = nil
- local Head = Char["Head"]
- local Torso = Char["Torso"]
- local Humanoid = Char["Humanoid"]
- local LA = Char["Left Arm"]
- local RA = Char["Right Arm"]
- local LL = Char["Left Leg"]
- local RL = Char["Right Leg"]
- local LS, RS;
- local OrigLS = Torso["Left Shoulder"]
- local OrigRS = Torso["Right Shoulder"]
- for _,v in pairs(Char:GetChildren()) do
- if v.Name == ModID then
- v:Destroy()
- end
- end
- for _,v in pairs(PlrGui:GetChildren()) do
- if v.Name == "PadsGui" then
- v:Destroy()
- end
- end
- local ModID = "Pads"
- local Objects = {}
- local Grav = 196.2
- local sin=math.sin
- local cos=math.cos
- local max=math.max
- local min=math.min
- local atan2=math.atan2
- local random=math.random
- local tau = 2 * math.pi
- local BodyObjects = {
- ["BodyVelocity"] = true;
- ["BodyAngularVelocity"] = true;
- ["BodyForce"] = true;
- ["BodyThrust"] = true;
- ["BodyPosition"] = true;
- ["RocketPropulsion"] = true;
- }
- if LP.Name == PlrName and isScriptNil then
- script.Parent = nil
- end
- LP.CameraMode = "Classic"
- local Assets = {
- }
- local LS0, LS1 = OrigLS.C0, OrigLS.C1
- local RS0, RS1 = OrigRS.C0, OrigRS.C1
- for i,v in pairs(Assets) do
- local ID = tostring(Assets[i])
- Assets[i] = "http://www.roblox.com/asset/?id=" .. ID
- Content:Preload("http://www.roblox.com/asset/?id=" .. ID)
- end
- function QuaternionFromCFrame(cf)
- local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components();
- local trace = m00 + m11 + m22 if trace > 0 then
- local s = math.sqrt(1 + trace);
- local recip = 0.5/s;
- return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5;
- else
- local i = 0;
- if m11 > m00 then
- i = 1;
- end;
- if m22 > (i == 0 and m00 or m11) then
- i = 2 end if i == 0 then
- local s = math.sqrt(m00-m11-m22+1);
- local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip;
- elseif i == 1 then
- local s = math.sqrt(m11-m22-m00+1);
- local recip = 0.5/s;
- return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip ;
- elseif i == 2 then
- local s = math.sqrt(m22-m00-m11+1);
- local recip = 0.5/s;
- return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip;
- end;
- end;
- end;
- function QuaternionToCFrame(px, py, pz, x, y, z, w)
- local xs, ys, zs = x + x, y + y, z + z;
- local wx, wy, wz = w*xs, w*ys, w*zs;
- local xx = x*xs;
- local xy = x*ys;
- local xz = x*zs;
- local yy = y*ys;
- local yz = y*zs;
- local zz = z*zs;
- return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
- end;
- function QuaternionSlerp(a, b, t)
- local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4];
- local startInterp, finishInterp;
- if cosTheta >= 0.0001 then
- if (1 - cosTheta) > 0.0001 then
- local theta = math.acos(cosTheta);
- local invSinTheta = 1/math.sin(theta);
- startInterp = math.sin((1-t)*theta)*invSinTheta;
- finishInterp = math.sin(t*theta)*invSinTheta;
- else
- startInterp = 1-t finishInterp = t;
- end;
- else
- if (1+cosTheta) > 0.0001 then
- local theta = math.acos(-cosTheta);
- local invSinTheta = 1/math.sin(theta);
- startInterp = math.sin((t-1)*theta)*invSinTheta;
- finishInterp = math.sin(t*theta)*invSinTheta;
- else startInterp = t-1 finishInterp = t;
- end;
- end;
- return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp;
- end;
- function CLerp(a,b,t)
- local qa={QuaternionFromCFrame(a)};
- local qb={QuaternionFromCFrame(b)};
- local ax,ay,az=a.x,a.y,a.z;
- local bx,by,bz=b.x,b.y,b.z;
- local _t=1-t;
- return QuaternionToCFrame(_t*ax+t*bx,_t*ay+t*by,_t*az+t*bz,QuaternionSlerp(qa, qb, t));
- end
- function GetWeld(weld)
- local obj
- for i, v in pairs(AnimJoints) do
- if v[1] == weld then
- obj = v
- break
- end
- end
- if not obj then
- obj = {weld,NV}
- table.insert(AnimJoints,obj)
- end
- return weld.C0.p, obj[2]
- end
- function SetWeld(weld, i, loops, origpos, origangle, nextpos, nextangle, override, overrideLower, smooth)
- smooth = smooth or 1
- local obj
- for i, v in pairs(AnimJoints) do
- if v[1] == weld then
- obj = v
- break
- end
- end
- if not obj then
- obj = {weld,NV}
- table.insert(AnimJoints,obj)
- end
- local perc = (smooth == 1 and math.sin((math.pi/2)/loops*i)) or i/loops
- local tox,toy,toz = 0,0,0
- tox = math.abs(origangle.x - nextangle.x) *perc
- toy = math.abs(origangle.y - nextangle.y) *perc
- toz = math.abs(origangle.z - nextangle.z) *perc
- tox = ((origangle.x > nextangle.x and -tox) or tox)
- toy = ((origangle.y > nextangle.y and -toy) or toy)
- toz = ((origangle.z > nextangle.z and -toz) or toz)
- local tox2,toy2,toz2 = 0,0,0
- tox2 = math.abs(origpos.x - nextpos.x) *perc
- toy2 = math.abs(origpos.y - nextpos.y) *perc
- toz2 = math.abs(origpos.z - nextpos.z) *perc
- tox2 = (origpos.x > nextpos.x and -tox2) or tox2
- toy2 = (origpos.y > nextpos.y and -toy2) or toy2
- toz2 = (origpos.z > nextpos.z and -toz2) or toz2
- obj[2] = Vector3.new(origangle.x + tox, origangle.y + toy, origangle.z + toz)
- weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
- end
- function RotateCamera(x, y)
- Camera.CoordinateFrame = CFrame.new(Camera.Focus.p) * (Camera.CoordinateFrame - Camera.CoordinateFrame.p) * CFrame.Angles(x, y, 0) * CFrame.new(0, 0, (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude)
- end
- function GetAngles(cf)
- local lv = cf.lookVector
- return -math.asin(lv.y), math.atan2(lv.x, -lv.z)
- end
- local LastCamCF = Camera.CoordinateFrame
- function Look()
- if AlphaOn == true then
- local x, y = GetAngles(LastCamCF:toObjectSpace(Camera.CoordinateFrame))
- Camera.CoordinateFrame = LastCamCF
- RotateCamera(x * -(Alpha), y * -(Alpha))
- LastCamCF = Camera.CoordinateFrame
- end
- end
- function Cor(Func)
- local Ok, Err = coroutine.resume(coroutine.create(Func))
- if not Ok then
- print(Err)
- end
- end
- function Cor2(Func)
- local Ok, Err = ypcall(Func)
- if not Ok then
- print(Err)
- end
- end
- function MakePads()
- -- 1 - VTelekinesis
- P1 = Instance.new("Model")
- P1.Name = ModID
- -- 2 - RBase
- P2 = Instance.new("Part")
- P2.CFrame = CFrame.new(Vector3.new(21.100008, 1.95000589, 11.899971)) * CFrame.Angles(-0, 0, -0)
- P2.FormFactor = Enum.FormFactor.Custom
- P2.Size = Vector3.new(0.799999952, 0.200000003, 0.800000012)
- P2.Anchored = true
- P2.BrickColor = BrickColor.new("White")
- P2.Friction = 0.30000001192093
- P2.Shape = Enum.PartType.Block
- P2.Name = "RBase"
- P2.Parent = P1
- P2.Transparency = 1
- -- 3 - Mesh
- P3 = Instance.new("CylinderMesh")
- P3.Scale = Vector3.new(1, 0.5, 1)
- P3.Parent = P2
- -- 4 - LBase
- P4 = Instance.new("Part")
- P4.CFrame = CFrame.new(Vector3.new(18.100008, 1.95000589, 11.899971)) * CFrame.Angles(-0, 0, -0)
- P4.FormFactor = Enum.FormFactor.Custom
- P4.Size = Vector3.new(0.799999952, 0.200000003, 0.800000012)
- P4.Anchored = true
- P4.BrickColor = BrickColor.new("White")
- P4.Friction = 0.30000001192093
- P4.Shape = Enum.PartType.Block
- P4.Name = "LBase"
- P4.Parent = P1
- P4.Transparency = 1
- -- 5 - Mesh
- P5 = Instance.new("CylinderMesh")
- P5.Scale = Vector3.new(1, 0.5, 1)
- P5.Parent = P4
- -- 7 - Mesh
- P7 = Instance.new("CylinderMesh")
- P7.Scale = Vector3.new(1, 0.5, 1)
- P7.Parent = P6
- -- 9 - Mesh
- P9 = Instance.new("CylinderMesh")
- P9.Scale = Vector3.new(1, 0.5, 1)
- P9.Parent = P8
- -- 11 - Mesh
- P11 = Instance.new("CylinderMesh")
- P11.Scale = Vector3.new(1, 0.5, 1)
- P11.Parent = P10
- -- 13 - Mesh
- P13 = Instance.new("CylinderMesh")
- P13.Scale = Vector3.new(1, 0.5, 1)
- P13.Parent = P12
- -- 15 - Mesh
- P15 = Instance.new("CylinderMesh")
- P15.Scale = Vector3.new(1, 0.5, 1)
- P15.Parent = P14
- -- 17 - Mesh
- P17 = Instance.new("CylinderMesh")
- P17.Scale = Vector3.new(1, 0.5, 1)
- P17.Parent = P16
- P1.Parent = LP.Character
- P1:MakeJoints()
- return P1
- end
- weldModel = function(model, unanchor, rooty)
- local parts = {}
- local function recurse(object)
- if object:IsA("BasePart") then
- table.insert(parts, object)
- end
- for _,child in pairs(object:GetChildren()) do
- recurse(child)
- end
- end
- recurse(model)
- local rootPart = rooty or parts[1]
- for _, part in pairs(parts) do
- local cframe = rootPart.CFrame:toObjectSpace(part.CFrame)
- local weld = Instance.new("Weld")
- weld.Part0 = rootPart
- weld.Part1 = part
- weld.C0 = cframe
- weld.Parent = rootPart
- end
- if unanchor then
- for _, part in pairs(parts) do
- part.Anchored = false
- part.CanCollide = false
- end
- end
- end
- weldItem = function(rootPart, Item, TheC0, unanchor, ParentItem)
- local cframe = TheC0 or rootPart.CFrame:toObjectSpace(Item.CFrame)
- local weld = Instance.new("Weld")
- weld.Name = "Weld"
- weld.Part0 = rootPart
- weld.Part1 = Item
- weld.C0 = cframe
- weld.Parent = ParentItem and Item or rootPart
- if unanchor then
- Item.Anchored = false
- end
- return weld, cframe
- end
- scaleModel = function(model, scale)
- local parts = {}
- local function recurse(object)
- if object:IsA("BasePart") then
- table.insert(parts, object)
- end
- for _,child in pairs(object:GetChildren()) do
- recurse(child)
- end
- end
- recurse(model)
- local top, bottom, left, right, back, front
- for _, part in pairs(parts) do
- if top == nil or top < part.Position.y then top = part.Position.y end
- if bottom == nil or bottom > part.Position.y then bottom = part.Position.y end
- if left == nil or left > part.Position.x then left = part.Position.x end
- if right == nil or right < part.Position.x then right = part.Position.x end
- if back == nil or back > part.Position.z then back = part.Position.z end
- if front == nil or front < part.Position.z then front = part.Position.z end
- end
- local middle = Vector3.new( left+right, top+bottom, back+front )/2
- local minSize = Vector3.new(0.2, 0.2, 0.2)
- for _, part in pairs(parts) do
- local foo = part.CFrame.p - middle
- local rotation = part.CFrame - part.CFrame.p
- local newSize = part.Size*scale
- part.FormFactor = "Custom"
- part.Size = newSize
- part.CFrame = CFrame.new( middle + foo*scale ) * rotation
- if newSize.x < minSize.x or newSize.y < minSize.y or newSize.z < minSize.z then
- local mesh
- for _, child in pairs(part:GetChildren()) do
- if child:IsA("DataModelMesh") then
- mesh = child
- break
- end
- end
- if mesh == nil then
- mesh = Instance.new("BlockMesh", part)
- end
- local oScale = mesh.Scale
- local newScale = newSize/minSize * oScale
- if 0.2 < newSize.x then newScale = Vector3.new(1 * oScale.x, newScale.y, newScale.z) end
- if 0.2 < newSize.y then newScale = Vector3.new(newScale.x, 1 * oScale.y, newScale.z) end
- if 0.2 < newSize.z then newScale = Vector3.new(newScale.x, newScale.y, 1 * oScale.z) end
- mesh.Scale = newScale
- end
- end
- end
- function getMass(Obj, Total)
- local newTotal = Total
- local returnTotal = 0
- if Obj:IsA("BasePart") then
- newTotal = newTotal + Objects[Obj]
- elseif BodyObjects[Obj.ClassName] then
- Obj:Destroy()
- end
- if Obj:GetChildren() and #Obj:GetChildren() > 0 then
- for _,v in pairs(Obj:GetChildren()) do
- returnTotal = returnTotal + getMass(v, newTotal)
- end
- else
- returnTotal = newTotal
- end
- return returnTotal
- end
- function getTargFromCurrent()
- local Current = Current.Part
- if Current:IsA("BasePart") then
- return Current
- elseif Current:findFirstChild("Torso") then
- return Current.Torso
- else
- for _,v in pairs(Current:GetChildren()) do
- if v:IsA("BasePart") then
- return v
- end
- end
- end
- end
- function Fire(Part, Vec, Inv)
- pcall(function()
- Current.BP:Destroy()
- Current.BP = nil
- end)
- pcall(function()
- Current.BA:Destroy()
- Current.BA = nil
- end)
- pcall(function()
- if Inv then
- Part.Velocity = -((Vec - Torso.Position).unit * Grav * 1.1)
- else
- Part.Velocity = ((Vec - Camera.CoordinateFrame.p).unit * Grav * 1.1)
- end
- Current.Mass = nil
- end)
- Reset()
- end
- function Reset()
- LS.Parent = nil
- RS.Parent = nil
- OrigLS.Parent = Torso
- OrigRS.Parent = Torso
- OrigLS.C0 = LS0
- OrigRS.C0 = RS0
- end
- function Start()
- Cor(function()
- repeat wait(1/30) until LP.Character and LP.Character.Parent == Workspace and LP.Character:findFirstChild("Torso")
- Char = LP.Character
- PlrGui = LP.PlayerGui
- Backpack = LP.Backpack
- Mouse = LP:GetMouse()
- for _,v in pairs(Cons) do
- v:disconnect()
- end
- Cons = {}
- Camera = Workspace.CurrentCamera
- LastCamCF = Camera.CoordinateFrame
- AnimJoints = {}
- mDown = false
- Multi = false
- Grabbing = false
- Current = {}
- Alpha = 1
- Head = Char["Head"]
- Torso = Char["Torso"]
- Humanoid = Char["Humanoid"]
- LA = Char["Left Arm"]
- RA = Char["Right Arm"]
- LL = Char["Left Leg"]
- RL = Char["Right Leg"]
- OrigLS = Torso["Left Shoulder"]
- OrigRS = Torso["Right Shoulder"]
- for _,v in pairs(Char:GetChildren()) do
- if v.Name == ModID then
- v:Destroy()
- end
- end
- for _,v in pairs(PlrGui:GetChildren()) do
- if v.Name == "PadsGui" then
- v:Destroy()
- end
- end
- LS = Instance.new("Weld")
- RS = Instance.new("Weld")
- LS.Name = OrigLS.Name
- LS.Part0 = Torso
- LS.Part1 = LA
- LS.C0 = LS0
- LS.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- RS.Name = OrigRS.Name
- RS.Part0 = Torso
- RS.Part1 = RA
- RS.C0 = RS0
- RS.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- local Pads = MakePads()
- local LPad = Pads.LBase
- local RPad = Pads.RBase
- weldModel(LPad, true, LPad)
- weldModel(RPad, true, RPad)
- local GripWeldL = Instance.new("Weld")
- GripWeldL.Name = "GripWeldL"
- GripWeldL.Part0 = LA
- GripWeldL.Part1 = LPad
- GripWeldL.C0 = CFrame.new(0, -1.05, 0) * CFrame.Angles(0, math.rad(180), 0)
- GripWeldL.Parent = LA
- local GripWeldR = Instance.new("Weld")
- GripWeldR.Name = "GripWeldR"
- GripWeldR.Part0 = RA
- GripWeldR.Part1 = RPad
- GripWeldR.C0 = CFrame.new(0, -1.05, 0) * CFrame.Angles(0, math.rad(180), 0)
- GripWeldR.Parent = RA
- local isParts = false
- table.insert(Cons, Mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == "z" then
- --Stuff
- elseif Key == "f" then
- local Current = Current.Part
- if Current and Current.Parent ~= nil and not Multi then
- Current:BreakJoints()
- end
- elseif Key == "q" then
- if isParts then
- isParts = false
- for _,v in pairs(Workspace:GetChildren()) do
- if v.Name == "MyPartV" and v:IsA("BasePart") then
- v:Destroy()
- end
- end
- else
- isParts = true
- for i = 1, 50 do
- local Part = Instance.new("Part")
- Part.Color = Color3.new(math.random(), math.random(), math.random())
- Part.Transparency = 0
- Part.Size = Vector3.new(math.random(1, 3), math.random(1, 3), math.random(1, 3))
- Part.Archivable = true
- Part.CanCollide = false
- Part.Material = "Neon"
- Part.Locked = false
- Part.CFrame = Torso.CFrame * CFrame.new(math.random(-15, 15), -1, math.random(-15, 15))
- Part.Anchored = true
- Part.Name = "MyPartV"
- Part.TopSurface = "Smooth"
- Part.BottomSurface = "Smooth"
- Part.Parent = Workspace
- end
- end
- elseif Key == "e" then
- local Targ;
- if Current.Part and Current.Part ~= nil then
- Targ = getTargFromCurrent()
- else
- Targ = LastPart
- end
- if Targ and Targ.Parent ~= nil and not Multi then
- local Ex = Instance.new("Explosion", Workspace)
- Ex.Position = Targ.CFrame.p
- Ex.BlastRadius = 16
- Ex.DestroyJointRadiusPercent = 0.5
- end
- elseif Key == "c" then
- if Current.Part and Current.Part.Parent ~= nil and not Multi then
- local Part = getTargFromCurrent()
- if Part then
- Grabbing = false
- if Mouse.Hit then
- local TargPos = CFrame.new(Camera.CoordinateFrame.p, Mouse.Hit.p) * CFrame.new(0, 0, -1000)
- Fire(Part, TargPos.p)
- else
- Fire(Part, Mouse.Origin.p + Mouse.UnitRay.Direction, true)
- end
- end
- end
- end
- end))
- table.insert(Cons, Mouse.Button1Up:connect(function()
- mDown = false
- if Grabbing == true and Multi == false then
- Grabbing = false
- Reset()
- end
- if Current.Part ~= nil then
- LastPart = getTargFromCurrent()
- Current = {}
- end
- end))
- local function makeLightning(Par, Start, End, Width, Length, RandomScale, ArcScale, Num1)
- local oldParts = {}
- for _,v in pairs(Par:GetChildren()) do
- v.CFrame = CFrame.new(5e5, 5e5, 5e5)
- table.insert(oldParts, v)
- end
- local Distance = (Start-End).Magnitude
- local ArcScale = ArcScale or 1
- local RandomScale = RandomScale or 0
- local Last = Start
- local IterNum = 0
- while Par.Parent do
- IterNum = IterNum + 1
- local New = nil
- if (Last-End).Magnitude < Length then
- New = CFrame.new(End)
- else
- if (End-Last).Magnitude < Length*2 then
- RandomScale = RandomScale*0.5
- ArcScale = ArcScale*0.5
- end
- local Direct = CFrame.new(Last,End)
- New = Direct*CFrame.Angles(math.rad(math.random(-RandomScale/4,RandomScale*ArcScale)),math.rad(math.random(-RandomScale,RandomScale)),math.rad(math.random(-RandomScale,RandomScale)))
- New = New*CFrame.new(0,0,-Length)
- end
- local Trail = nil
- if oldParts[IterNum] then
- Trail = oldParts[IterNum]
- Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Persimmon")) or BrickColor.new("Really red")
- Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
- Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
- oldParts[IterNum] = nil
- else
- Trail = Instance.new("Part")
- Trail.Name = "Part"
- Trail.FormFactor = "Custom"
- Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("White")) or BrickColor.new("White")
- Trail.Transparency = 0
- Trail.Anchored = true
- Trail.CanCollide = false
- Trail.Locked = true
- Trail.BackSurface = "SmoothNoOutlines"
- Trail.BottomSurface = "SmoothNoOutlines"
- Trail.FrontSurface = "SmoothNoOutlines"
- Trail.LeftSurface = "SmoothNoOutlines"
- Trail.RightSurface = "SmoothNoOutlines"
- Trail.TopSurface = "SmoothNoOutlines"
- Trail.Material = "Neon"
- Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
- Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
- Trail.Parent = Par
- end
- Last = New.p
- if (Last-End).Magnitude < 1 then
- break
- end
- end
- for _,v in pairs(oldParts) do
- v:Destroy()
- end
- end
- table.insert(Cons, Mouse.Button1Down:connect(function()
- mDown = true
- local Targ = Mouse.Target
- Cor(function()
- if Targ and Objects[Targ] and not Multi then
- Grabbing = true
- Current.Part = Targ
- local Mass = Objects[Targ]
- local ForceNum = 0
- local Hum = nil
- for _,v in pairs(Targ:GetChildren()) do
- if BodyObjects[v.ClassName] then
- v:Destroy()
- end
- end
- for _,v in pairs(Workspace:GetChildren()) do
- if v:findFirstChild("Humanoid") and v:IsAncestorOf(Targ) then
- Hum = v.Humanoid
- Mass = getMass(v, 0)
- Current.Part = v
- break
- end
- end
- Current.Mass = Mass
- if not Hum then
- Targ:BreakJoints()
- end
- ForceNum = Mass * Grav
- Targ.CanCollide = true
- Targ.Anchored = false
- local BP = Instance.new("BodyPosition")
- BP.maxForce = Vector3.new(3 * ForceNum, 3 * ForceNum, 3 * ForceNum)
- BP.Parent = Targ
- local Ang = Instance.new("BodyAngularVelocity")
- Ang.Parent = Targ
- Current.BP = BP
- Current.BA = Ang
- OrigLS.Parent = nil
- OrigRS.Parent = nil
- LS.Parent = Torso
- RS.Parent = Torso
- LS.C0 = LS0
- RS.C0 = RS0
- local DirDot = Mouse.UnitRay.Direction:Dot(Targ.Position - Mouse.Origin.p)
- local BPPos = Vector3.new(0, 0, 0)
- local Vel = Vector3.new(0, 0, 0)
- local Vlev = random() * math.pi
- local RPos = Vector3.new(random() * 2 - 1, cos(Vlev), random() * 2 - 1)
- local Ball = Instance.new("Part")
- Ball.Name = "Ball"
- Ball.FormFactor = "Custom"
- Ball.Color = Color3.new(0, 1, 1)
- Ball.Transparency = 0.3
- Ball.Anchored = true
- Ball.CanCollide = false
- Ball.Locked = true
- Ball.BottomSurface, Ball.TopSurface = "Smooth", "Smooth"
- Ball.Size = Vector3.new(0.5, 0.5, 0.5)
- Ball.CFrame = Torso.CFrame * CFrame.new(0, 1, -3)
- Ball.Parent = Char
- if Targ.Name == "MyPartV" then
- Targ.Name = "MyPartF"
- end
- local LightMod = Instance.new("Model", Char)
- local Mesh = Instance.new("SpecialMesh")
- Mesh.MeshType = "Sphere"
- Mesh.Parent = Ball
- local Size = 0.5
- local Rise = true
- while Grabbing and BP and Ang and Targ.Parent ~= nil do
- local BPPos = Mouse.Origin.p + Mouse.UnitRay.Direction * DirDot
- Ang.angularvelocity = Vel
- BP.position = BPPos + RPos
- RPos = Vector3.new(max(-1, min(RPos.x + random() * 0.02 - 0.01, 1)), cos(Vlev), max(-1, min(RPos.z + random() * 0.02 - 0.01, 1)))
- Vel = Vector3.new(max(-1, min(Vel.x + random() * 0.2 - 0.1, 1)), max(-1, min(Vel.y + random() * 0.2 - 0.1, 1)), max(-1, min(Vel.z + random() * 0.2 - 0.1, 1)))
- Vlev = (Vlev + 0.05) % tau
- if Hum then
- Hum.Sit = true
- end
- if LA.Parent ~= nil and RA.Parent ~= nil then
- local LPos = (LA.CFrame * CFrame.new(0, -1, 0)).p
- local RPos = (RA.CFrame * CFrame.new(0, -1, 0)).p
- if Rise == true then
- if Size < 0.6 then
- Size = Size + 0.05
- else
- Size = Size + 0.1
- end
- if Size >= 2.2 then
- Rise = false
- end
- else
- if Size > 2.1 then
- Size = Size - 0.05
- else
- Size = Size - 0.1
- end
- if Size <= 0.5 then
- Rise = true
- end
- end
- Ball.Size = Vector3.new(Size, Size, Size)
- Ball.CFrame = CFrame.new(LPos:Lerp(RPos, 0.5), Targ.Position) * CFrame.new(0, 0, -2.2)
- LightNum = LightNum + 1
- makeLightning(LightMod, Ball.Position, Targ.Position, 0.2, 4, 50, 1, LightNum)
- elseif Ball.Parent ~= nil then
- Ball:Destroy()
- end
- if LS and LS.Parent == Torso then
- LS.C0 = CFrame.new(Vector3.new(-1.5, 0.5, 0), Torso.CFrame:pointToObjectSpace((Targ.CFrame or Torso.CFrame * CFrame.new(-1.5, 0.5, 1)).p))
- end
- if RS and RS.Parent == Torso then
- RS.C0 = CFrame.new(Vector3.new(1.5, 0.5, 0), Torso.CFrame:pointToObjectSpace((Targ.CFrame or Torso.CFrame * CFrame.new(1.5, 0.5, 1)).p))
- end
- RunService.Heartbeat:wait()
- end
- coroutine.resume(coroutine.create(function()
- for i = 0.5, 1, 0.1 do
- for i2,v in pairs(LightMod:GetChildren()) do
- --v.Light.Range = 6-(i*5)
- v.Transparency = i
- end
- wait(1/30)
- end
- LightMod:Destroy()
- end))
- if BP and BP.Parent ~= nil then
- BP:Destroy()
- end
- if Ang and Ang.Parent ~= nil then
- Ang:Destroy()
- end
- pcall(function() Ball:Destroy() end)
- end
- end)
- end))
- end)
- end
- function Add(Obj)
- if Obj:IsA("BasePart") and not Objects[Obj] and not (Obj.Name == "Base" and Obj.ClassName == "Part") then
- Objects[Obj] = Obj:GetMass()
- Obj.Changed:connect(function(P)
- if P:lower() == "size" and Objects[Obj] and Obj.Parent ~= nil then
- Objects[Obj] = Obj:GetMass()
- end
- end)
- end
- end
- function Rem(Obj)
- if Objects[Obj] then
- Objects[Obj] = nil
- end
- end
- function Recursion(Obj)
- ypcall(function()
- Add(Obj)
- if #Obj:GetChildren() > 0 then
- for _,v in pairs(Obj:GetChildren()) do
- Recursion(v)
- end
- end
- end)
- end
- Workspace.DescendantAdded:connect(function(Obj)
- Add(Obj)
- end)
- Workspace.DescendantRemoving:connect(function(Obj)
- Rem(Obj)
- end)
- for _,v in pairs(Workspace:GetChildren()) do
- Recursion(v)
- end
- Start()
- if LP.Name == PlrName then
- LP.CharacterAdded:connect(Start)
- end
- local verlet = {}
- verlet.step_time = 1 / 50
- verlet.gravity = Vector3.new(0, -10, 0)
- local char = game.Players.LocalPlayer.Character
- local torso = char:WaitForChild("Torso")
- local parts = {}
- local render = game:GetService("RunService").RenderStepped
- wait(2)
- local point = {}
- local link = {}
- local rope = {}
- local function ccw(A,B,C)
- return (C.y-A.y) * (B.x-A.x) > (B.y-A.y) * (C.x-A.x)
- end
- local function intersect(A,B,C,D)
- return ccw(A,C,D) ~= ccw(B,C,D) and ccw(A,B,C) ~= ccw(A,B,D)
- end
- local function vec2(v)
- return Vector2.new(v.x, v.z)
- end
- function point:step()
- if not self.fixed then
- local derivative = (self.position - self.last_position) * 0.95
- self.last_position = self.position
- self.position = self.position + derivative + (self.velocity * verlet.step_time ^ 2)
- --[[local torsoP = torso.CFrame * CFrame.new(-1, 0, 0.5)
- local torsoE = torso.CFrame * CFrame.new(1, 0, 0.5)
- local pointE = self.position + torso.CFrame.lookVector * 100
- local doIntersect = intersect(vec2(torsoP.p), vec2(torsoE.p), vec2(self.position), vec2(pointE))
- if not doIntersect then
- self.postition = self.position - torso.CFrame.lookVector * 10
- end]]
- end
- end
- function link:step()
- for i = 1, 1 do
- local distance = self.point1.position - self.point2.position
- local magnitude = distance.magnitude
- local differance = (self.length - magnitude) / magnitude
- local translation = ((self.point1.fixed or self.point2.fixed) and 1 or 0.6) * distance * differance
- if not self.point1.fixed then
- self.point1.position = self.point1.position + translation
- end
- if not self.point2.fixed then
- self.point2.position = self.point2.position - translation
- end
- end
- end
- function verlet.new(class, a, b, c)
- if class == "Point" then
- local new = {}
- setmetatable(new, {__index = point})
- new.class = class
- new.position = a or Vector3.new()
- new.last_position = new.position
- new.velocity = verlet.gravity
- new.fixed = false
- return new
- elseif class == "Link" then
- local new = {}
- setmetatable(new, {__index = link})
- new.class = class
- new.point1 = a
- new.point2 = b
- new.length = c or (a.position - b.position).magnitude
- return new
- elseif class == "Rope" then
- local new = {}
- setmetatable(new, {__index = link})
- new.class = class
- new.start_point = a
- new.finish_point = b
- new.points = {}
- new.links = {}
- local inc = (b - a) / 10
- for i = 0, 10 do
- table.insert(new.points, verlet.new("Point", a + (i * inc)))
- end
- for i = 2, #new.points do
- table.insert(new.links, verlet.new("Link", new.points[i - 1], new.points[i]))
- end
- return new
- end
- end
- local tris = {}
- local triParts = {}
- local function GetDiscoColor(hue)
- local section = hue % 1 * 3
- local secondary = 0.5 * math.pi * (section % 1)
- if section < 1 then
- return Color3.new(0, 0, 0)
- elseif section < 2 then
- return Color3.new(0, 0, 0)
- else
- return Color3.new(0, 0, 0)
- end
- end
- local function setupPart(part)
- part.Anchored = true
- part.FormFactor = 3
- part.CanCollide = false
- part.TopSurface = 10
- part.BottomSurface = 10
- part.LeftSurface = 10
- part.RightSurface = 10
- part.FrontSurface = 10
- part.BackSurface = 10
- part.Material = "Neon"
- local m = Instance.new("SpecialMesh", part)
- m.MeshType = "Wedge"
- m.Scale = Vector3.new(0.2, 1, 1)
- return part
- end
- local function CFrameFromTopBack(at, top, back)
- local right = top:Cross(back)
- return CFrame.new(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
- end
- local function drawTri(parent, a, b, c)
- local this = {}
- local mPart1 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
- local mPart2 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
- function this:Set(a, b, c)
- local ab, bc, ca = b-a, c-b, a-c
- local abm, bcm, cam = ab.magnitude, bc.magnitude, ca.magnitude
- local edg1 = math.abs(0.5 + ca:Dot(ab)/(abm*abm))
- local edg2 = math.abs(0.5 + ab:Dot(bc)/(bcm*bcm))
- local edg3 = math.abs(0.5 + bc:Dot(ca)/(cam*cam))
- if edg1 < edg2 then
- if edg1 >= edg3 then
- a, b, c = c, a, b
- ab, bc, ca = ca, ab, bc
- abm = cam
- end
- else
- if edg2 < edg3 then
- a, b, c = b, c, a
- ab, bc, ca = bc, ca, ab
- abm = bcm
- else
- a, b, c = c, a, b
- ab, bc, ca = ca, ab, bc
- abm = cam
- end
- end
- local len1 = -ca:Dot(ab)/abm
- local len2 = abm - len1
- local width = (ca + ab.unit*len1).magnitude
- local maincf = CFrameFromTopBack(a, ab:Cross(bc).unit, -ab.unit)
- if len1 > 0.2 then
- mPart1.Parent = parent
- mPart1.Size = Vector3.new(0.2, width, len1)
- mPart1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
- else
- mPart1.Parent = nil
- end
- if len2 > 0.2 then
- mPart2.Parent = parent
- mPart2.Size = Vector3.new(0.2, width, len2)
- mPart2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
- else
- mPart2.Parent = nil
- end
- end
- function this:SetProperty(prop, value)
- mPart1[prop] = value
- mPart2[prop] = value
- end
- this:Set(a, b, c)
- function this:Destroy()
- mPart1:Destroy()
- mPart2:Destroy()
- end
- this.p1 = mPart1
- this.p2 = mPart2
- this.p1.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p1.CFrame.Y * 0.5 + time())))
- this.p2.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p2.CFrame.Y * 0.5 + time())))
- return this
- end
- function verlet.draw(object, id)
- if object.class == "Point" then
- local part = parts[id]
- part.BrickColor = BrickColor.new(255, 0, 0)
- part.Transparency = 0
- part.formFactor = 3
- part.Anchored = true
- part.CanCollide = false
- part.TopSurface = 0
- part.BottomSurface = 0
- part.Size = Vector3.new(0.35, 0.35, 0.35)
- part.Material = "Neon"
- part.CFrame = CFrame.new(object.position)
- part.Parent = torso
- return part
- elseif object.class == "Link" then
- local part = parts[id]
- local dist = (object.point1.position - object.point2.position).magnitude
- part.Size = Vector3.new(0.2, 0.2, dist)
- part.CFrame = CFrame.new(object.point1.position, object.point2.position) * CFrame.new(0, 0, dist * -0.5)
- part.Parent = torso
- return part
- end
- end
- function verlet.clear()
- for _, v in pairs(workspace:GetChildren()) do
- if v.Name == "Part" then
- v:Destroy()
- end
- end
- end
- local points = {}
- local links = {}
- for x = 0, 2 do
- points[x] = {}
- for y = 0, 3 do
- points[x][y] = verlet.new("Point", torso.Position + Vector3.new(x * 0.8 - 2, 2 - y * 0.8, 5 + y * 0.4))
- points[x][y].fixed = y == 0
- end
- end
- for x = 1, 2 do
- for y = 0, 3 do
- links[#links + 1] = verlet.new("Link", points[x][y], points[x - 1][y], 1 + y * 0.08)
- end
- end
- for x = 0, 2 do
- for y = 1, 3 do
- links[#links + 1] = verlet.new("Link", points[x][y], points[x][y - 1], 1.2 + y * 0.03)
- end
- end
- render:connect(function()
- for x = 0, 2 do
- for y = 0, 3 do
- if y == 0 then
- points[x][y].position = (torso.CFrame * CFrame.new(x * 1 - 1, 1, 0.5)).p
- else
- points[x][y]:step()
- end
- end
- end
- for i = 1, #links do
- links[i]:step()
- end
- for i = 1, #tris do
- triParts[#triParts + 1] = tris[i].p1
- triParts[#triParts + 1] = tris[i].p2
- end
- tris = {}
- for x = 1, 2 do
- for y = 1, 3 do
- tris[#tris + 1] = drawTri(torso, points[x - 1][y - 1].position, points[x - 1][y].position, points[x][y - 1].position)
- tris[#tris + 1] = drawTri(torso, points[x][y].position, points[x - 1][y].position, points[x][y - 1].position)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement