Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- CoreEffectsHandler [XeverCaiver]
- BaseCoreEffectsHandler
- Leaning
- CloudParticles
- --]]
- local Player = game.Players.LocalPlayer
- -- Services
- local CollectionService = game:GetService("CollectionService")
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- local Players = game:GetService("Players")
- local RenderDistance = 500
- local CoreEffectsEvent
- local Smoothness = 12
- local NotAffected = {}
- CoreEffectsEvent = RunService.Stepped:Connect(function(Time, Step)
- for Index, Character in pairs(CollectionService:GetTagged("OnEffect")) do
- local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
- if (HumanoidRootPart) then
- if (Player:DistanceFromCharacter(HumanoidRootPart.Position) <= RenderDistance) then
- local Torso = Character:FindFirstChild("Torso")
- if (Torso) then
- local RootHip = HumanoidRootPart:FindFirstChild("RootJoint")
- local RightHip = Torso:FindFirstChild("Right Hip")
- local LeftHip = Torso:FindFirstChild("Left Hip")
- local Neck = Torso:FindFirstChild("Neck")
- print(RootHip, RightHip, LeftHip, Neck, Torso)
- if (RootHip and RightHip and LeftHip and Neck) then
- local Dot = HumanoidRootPart.Velocity:Dot(HumanoidRootPart.CFrame.RightVector)
- --print(Dot)
- RootHip.C0 = RootHip.C0:lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) * CFrame.Angles(0, -math.rad(math.clamp(Dot * 4, -12, 12)), 0), 1*Step*Smoothness)
- LeftHip.C0 = LeftHip.C0:lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08) * CFrame.Angles(math.rad(math.clamp(Dot * 2, -8, 8)), 0, 0), 1*Step*Smoothness)
- RightHip.C0 = RightHip.C0:lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08) * CFrame.Angles(-math.rad(math.clamp(Dot * 2, -8, 8)), 0, 0), 1*Step*Smoothness)
- end
- end
- end
- end
- end
- end)
- function AddTag(Player)
- if Player.Character then
- CollectionService:AddTag(Player.Character, "OnEffect")
- end
- Player.CharacterAdded:Connect(function(Character)
- CollectionService:AddTag(Character, "OnEffect")
- end)
- end
- for Index, Player in pairs(Players:GetPlayers()) do AddTag(Player) end
- Players.PlayerAdded:Connect(AddTag)
Add Comment
Please, Sign In to add comment