Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until game.Players.LocalPlayer
- local UIS = game:GetService("UserInputService")
- local RS = game:GetService("ReplicatedStorage")
- local RunService = game:GetService("RunService")
- local func = RS.Event.isShadowSneakCooldown
- local Player = game.Players.LocalPlayer;
- local Camera = game.Workspace.Camera;
- local Character = Player.Character;
- local controlToggle = {true,true};
- local BV = Instance.new("BodyVelocity");
- local Speed = 75;
- local Radius = 3;
- local Params = RaycastParams.new()
- Params.FilterDescendantsInstances = {Character};
- Params.FilterType = Enum.RaycastFilterType.Blacklist;
- local Params2 = OverlapParams.new();
- Params2.MaxParts = math.huge
- Params2.FilterDescendantsInstances = {Character,game.Workspace.Baseplate}
- Params2.FilterType = Enum.RaycastFilterType.Blacklist;
- UIS.InputBegan:Connect(function(Input, IsTyping)
- if IsTyping then return end
- if func:InvokeServer() then return end
- if Input.KeyCode == Enum.KeyCode.Z then
- if controlToggle[1] then
- RS.Event.SahdowSneak:FireServer(controlToggle[1],false);
- controlToggle[1] = false;
- controlToggle[2] = true;
- BV.Parent = Character.HumanoidRootPart;
- else
- --Character:WaitForChild("Humanoid").JumpPower = 50;
- RS.Event.SahdowSneak:FireServer(controlToggle[1],false);
- controlToggle[1] = true;
- controlToggle[2] = false;
- BV.MaxForce = Vector3.new()
- end
- end
- end)
- RunService.RenderStepped:Connect(function(dt)
- if not controlToggle[2] then return end
- if controlToggle[1] then return end
- BV.MaxForce = Vector3.new(400000,0,400000);
- local MainRay = workspace:Raycast((Character.HumanoidRootPart.CFrame).Position ,Vector3.new(0,-180,0),Params)
- if MainRay then
- local i = 0;
- i+=1
- BV.Velocity = Camera.CFrame.LookVector * math.cos(i) * Speed -- math.tan() is faster
- for Index,Value in pairs(workspace:GetPartBoundsInRadius((Character.HumanoidRootPart.CFrame).Position,Radius,Params2)) do
- if (Value.Parent:FindFirstChild("Humanoid")) then
- BV.MaxForce = Vector3.new();
- controlToggle[1] = true;
- controlToggle[2] = false;
- RS.Event.SahdowSneak:FireServer(controlToggle[2], true);
- end
- end
- end
- end)
- RS.Event.SahdowSneak.OnClientEvent:Connect(function(Player)
- controlToggle[1] = true;
- controlToggle[2] = false;
- BV.MaxForce = Vector3.new()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement