Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Start Naming Main variables--
- MSCRIPT3 = script
- script = script.Parent
- --Above names script to the script's parent. that makes it easier.--
- Control = script.Control
- Torso = script.Torso.Main
- LarmM = script["Left Arm"]
- Larm = {
- Hand = LarmM.Hand,
- For = LarmM.For,
- Back = LarmM.Back
- }
- RarmM = script["Right Arm"]
- Rarm = {
- Hand = RarmM.Hand,
- For = RarmM.For,
- Back = RarmM.Back
- }
- legs = script.Legs
- Legs = {
- Left = legs["Left Leg"].Main,
- Right = legs["Right Leg"].Main
- }
- larg = {
- H = Larm.Hand.BodyGyro,
- F = Larm.For.BodyGyro,
- B = Larm.Back.BodyGyro
- }
- rarg = {
- H = Rarm.Hand.BodyGyro,
- F = Rarm.For.BodyGyro,
- B = Rarm.Back.BodyGyro
- }
- leg = {
- L = Legs.Right.BodyGyro,
- R = Legs.Left.BodyGyro
- }
- TG = Torso.BodyGyro
- TV = Torso.BodyVelocity
- TBAV = Torso.BodyAngularVelocity
- ---Finish of setting the main variables, long, huh?---
- local highest = math.rad(45)
- local add = math.rad(7)
- local Amount = 0
- local TS = false --Tool Selected
- local Sit = false
- script.TS.Changed:connect(function()
- TS = script.TS.Value
- end)
- Control.ChildAdded:connect(function(c)
- local In = true
- Control.ChildRemoved:connect(function(cc)
- if cc == c then
- In = false
- end
- end)
- if c.Name == "SeatWeld" and c:IsA("Weld") then
- local plyr = game.Players:GetPlayerFromCharacter(c.Part1.Parent)
- if plyr == nil then plyr = game.Players:GetPlayerFromCharacter(c.Part0.Parent) end
- if plyr ~= nil then
- if plyr:findFirstChild("Backpack") == nil then return end
- if plyr.Character:findFirstChild("Right Arm") == nil then return end
- plyr.Character["Right Arm"].ChildAdded:connect(function(c)
- if In == false then return end
- if c.Name == "RightGrip" and c:IsA("Weld") then
- c.Part0 = RarmM.Hand
- LarmM.Hand:MakeJoints()
- script.TS.Value = true
- end
- end)
- plyr.Character["Right Arm"].ChildRemoved:connect(function(c)
- if In == false then return end
- if c.Name == "RightGrip" and c:IsA("Weld") then
- script.TS.Value = false
- end
- end)
- end
- end
- end)
- Walk = function()
- if Amount >= highest or Amount <= -highest then
- add = -add
- end
- Amount = Amount+add
- leg.L.cframe = Torso.CFrame*CFrame.Angles(Amount,0,0)
- leg.R.cframe = Torso.CFrame*CFrame.Angles(-Amount,0,0)
- larg.B.cframe = Torso.CFrame*CFrame.Angles(Amount,0,0)
- larg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(45/3),0,0)
- if TS == false then
- rarg.B.cframe = Torso.CFrame*CFrame.Angles(-Amount,0,0)
- rarg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(45/3),0,0)
- else
- rarg.B.cframe = Torso.CFrame*CFrame.Angles(math.rad(45+45/2),0,0)
- rarg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(45),0,0)
- end
- end
- Stand = function()
- leg.L.cframe = Torso.CFrame*CFrame.Angles(0,0,0)
- leg.R.cframe = Torso.CFrame*CFrame.Angles(0,0,0)
- larg.B.cframe = Torso.CFrame*CFrame.Angles(0,0,0)
- larg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(-45),0,0)
- rarg.B.cframe = Torso.CFrame*CFrame.Angles(0,0,0)
- rarg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(-45),0,0)
- if TS == true then
- rarg.B.cframe = Torso.CFrame*CFrame.Angles(math.rad(45+45/2),0,0)
- rarg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(45),0,0)
- end
- end
- Sit = function()
- leg.L.cframe = Torso.CFrame*CFrame.Angles(math.rad(90),0,0)
- leg.R.cframe = Torso.CFrame*CFrame.Angles(math.rad(90),0,0)
- larg.B.cframe = Torso.CFrame*CFrame.Angles(math.rad(45),0,0)
- larg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(90+45/2),0,0)
- rarg.B.cframe = Torso.CFrame*CFrame.Angles(math.rad(45),0,0)
- rarg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(90+45/2),0,0)
- if TS == true then
- rarg.B.cframe = Torso.CFrame*CFrame.Angles(math.rad(45+45/2),0,0)
- rarg.F.cframe = Torso.CFrame*CFrame.Angles(math.rad(45),0,0)
- end
- end
- while true do
- TV.velocity = (Torso.CFrame.lookVector*script.WalkSpeed.Value)*Control.Throttle
- TBAV.angularvelocity = Vector3.new(0,-5,0)*Control.Steer
- rarg.H.cframe = rarg.F.cframe
- larg.H.cframe = larg.F.cframe
- if Control.Throttle ~= 0 then
- Walk()
- elseif Sit == true then
- Sit()
- else
- Stand()
- end
- wait()
- end
Add Comment
Please, Sign In to add comment