Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print([[
- T = Do / undo a tpose
- I made this just to test my Motor/Weld Function and FE Function.
- - -._-. / Soft
- Ps press T two times tho on the first one
- https://pastebin.com/raw/76n6snGb
- ]])
- local function Get_New_Motor(rig,Instance_variant_1,type_)
- --[[
- // Description \\
- Returns new Motor6D based of Variant_1. Properites .C0 and .C1 will be defaulted to
- the default idle. The Main Purpose is to kill the animator so that the default walking
- animation does not interfere the CFrame animations. Note that the neck will kill
- the character and RootJoint will be excused.
- Parameter 1: (Instance) The Model that it will be using. Note that it has a Part named "Torso"
- Parameter 2: (Instance) Motor6D, creates a new Motor6D, most properties will be cloned.
- (Instance) The limb.
- Parameter 3: (boolean) Optional. If true it will return as a Motor6D, else, a weld. Difference
- between the two is that a Motor6D is compatable with the default animations, while a weld doesn't.
- --]]
- local Old_M6D
- local function Error_Msg(Res)
- print('Failed to load: '..Res)
- end
- if rig and Instance_variant_1 then
- if typeof(rig)=='Instance'and typeof(Instance_variant_1)=='Instance'then
- local torso = rig:FindFirstChild'Torso'
- if torso then
- if Instance_variant_1:IsA'Motor6D'then
- Old_M6D = Instance_variant_1
- elseif Instance_variant_1:IsA'BasePart'then
- for _,v in pairs(torso:GetChildren())do
- if v:IsA'Motor6D'then
- if v.Part1==Instance_variant_1 then
- Old_M6D = v
- break
- end
- end
- end
- end
- else Error_Msg'Can not find torso.'end
- else
- if typeof(rig)~='Instance'then Error_Msg'Argument "rig" is not an Instance.'end
- if typeof(Instance_variant_1)~='Instance'then Error_Msg'Argument Instance_variant_1 is not an Instance.'end end
- else
- if not rig then Error_Msg'Argument 1 is nil.'end
- if not Instance_variant_1 then Error_Msg'Argument 2 is nil.'end
- end
- if Old_M6D then
- local torso = rig.Torso
- local new_M6D
- if not type_ then
- new_M6D = Instance.new('Weld')
- else
- new_M6D = Instance.new("Motor6D")
- end
- new_M6D.Name = Old_M6D.Name
- new_M6D.Part0 = Old_M6D.Part0
- new_M6D.Part1 = Old_M6D.Part1
- local P1n = new_M6D.Part1.Name
- if P1n=='Left Arm'then
- new_M6D.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- new_M6D.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 0.999999881, 0, -4.37113812e-08)
- elseif P1n=='Right Arm'then
- new_M6D.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- new_M6D.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -0.999999881, 0, -4.37113812e-08)
- elseif P1n=='Left Leg'then
- new_M6D.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- new_M6D.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.999999881, 0, 0.99999994, 1.49011612e-08, -4.37113847e-08)
- elseif P1n=='Right Leg'then
- new_M6D.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- new_M6D.C1 = CFrame.new(0.5, 1, 1.1920929e-07, -4.37113883e-08, 0, 1, -2.08616257e-07, 0.999999881, -7.10542736e-15, -0.999999881, -1.49011612e-07, -4.37113847e-08)
- end
- new_M6D.Parent = torso
- Old_M6D:Destroy()
- return new_M6D
- end
- end
- wait(2)
- local pl = game:GetService("Players").SoftlockedUnderZero
- local tw = game:GetService("TweenService")
- local pc = pl.Character
- local LS = Get_New_Motor(pc,pc['Left Arm'])
- local RS = Get_New_Motor(pc,pc['Right Arm'])
- local is_tposing = false
- local not_cooldown = true
- local A_TweenInfo = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0)
- local LS_NewProp = {
- C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08),
- C1 = CFrame.new(0, 1, 0, 1.91068547e-15, -0.99999994, 4.37113883e-08, -4.37113883e-08, -4.37113847e-08, -1, 0.999999821, 0, -4.37113776e-08)
- }
- local RS_NewProp = {
- C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08),
- C1 = CFrame.new(0, 1, 0, 1.91068547e-15, 0.99999994, -4.37113883e-08, 4.37113883e-08, -4.37113847e-08, -1, -0.999999821, 0, -4.37113776e-08)
- }
- local LS_OldProp = {
- C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08),
- C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 0.999999762, 0, -4.37113741e-08)
- }
- local RS_OldProp = {
- C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08),
- C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 5.56362636e-08, 1, 2.43193853e-15, 0.99999994, -5.56362707e-08, -0.999999821, 0, -4.37113776e-08)
- }
- local LS_A = tw:Create(LS,A_TweenInfo,LS_NewProp)
- local RS_A = tw:Create(RS,A_TweenInfo,RS_NewProp)
- local LS_B = tw:Create(LS,A_TweenInfo,LS_OldProp)
- local RS_B = tw:Create(RS,A_TweenInfo,RS_OldProp)
- local function KeyCheck(k)
- if k=='t'and not_cooldown then
- not_cooldown = false
- is_tposing = not is_tposing
- if is_tposing then
- LS_A:Play()
- RS_A:Play()
- else
- LS_B:Play()
- RS_B:Play()
- end
- wait(1)
- not_cooldown = true
- end
- end
- local function Get_Components_Of_Mouse(player)
- --[[
- Just skip to the bottom. Also note: No UserInputService
- --]]
- local pchar = player.Character
- if pchar then
- local Remote = pchar:FindFirstChild('∞RE_Mouse')
- if not Remote then
- Remote = Instance.new("RemoteEvent",pchar)
- Remote.Name = 'RE_Mouse'
- end
- Remote.Parent = NLS(
- [[
- local lp = game:GetService'Players'.LocalPlayer
- local mouse = lp:GetMouse()
- local runs = game:GetService'RunService'
- wait(1)
- local re = script:WaitForChild('RE_Mouse')
- if re then
- mouse.KeyDown:Connect(function(k)
- re:FireServer('KeyDown',k)
- end)
- mouse.KeyUp:Connect(function(k)
- re:FireServer('KeyUp',k)
- end)
- mouse.Button1Down:Connect(function()
- re:FireServer('Button1Down')
- end)
- mouse.Button1Up:Connect(function()
- re:FireServer('Button1Up')
- end)
- mouse.Button2Down:Connect(function()
- re:FireServer('Button2Down')
- end)
- mouse.Button2Up:Connect(function()
- re:FireServer('Button2Up')
- end)
- runs.Heartbeat:Connect(function()
- local mh = mouse.Hit
- local mt = mouse.Target
- if mh and mt then
- re:FireServer('MouseInfo',mh,mt)
- end
- end)
- re.OnClientEvent:Connect(function(arg1,arg2)
- if arg1=='ChangeMouseIcon'then
- mouse.Icon = arg2
- end
- end)
- else
- print('Fat try again.')
- end
- ]]
- ,pchar)
- return Remote
- else
- error('Best to actually put your character in the game.')
- end
- end
- local RE = Get_Components_Of_Mouse(owner)
- -- Function returns Remote event
- if RE then
- RE.OnServerEvent:Connect(function(pl,arg1,arg2,arg3)
- if pl==owner then
- if arg1=='KeyDown'then
- KeyCheck(arg2)
- end
- end
- end)
- end
- --[[
- .OSE() Arguments:
- 'KeyDown', <string: Key pressed down>
- 'KeyUp', <string: Key pressed up>
- 'Button1Down'
- 'Button1Up'
- 'Button2Down'
- 'Button2Up'
- 'MouseInfo', <CFrame: Mouse.Hit> , <Instance: Mouse.Target>
- :FireClient Goods:
- owner,'ChangeMouseIcon', <string: new mouse.Icon asset id>
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement