Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game:GetService("Players").LocalPlayer;
- repeat wait() until player.Character;
- local character = player.Character;
- local h = character:WaitForChild("Humanoid");
- local UIS = game:GetService("UserInputService");
- local AnimationHandler = game:GetService("ReplicatedStorage"):WaitForChild("AnimationHandler");
- local ready = h:LoadAnimation(script:WaitForChild("Ready"));
- local sit = h:LoadAnimation(script:WaitForChild("Sit"));
- local bow = h:LoadAnimation(script:WaitForChild("Bow"));
- local beg = h:LoadAnimation(script:WaitForChild("Beg"));
- local kneel = h:LoadAnimation(script:WaitForChild("Kneel"));
- local sleep = h:LoadAnimation(script:WaitForChild("Sleep"));
- local shove = h:LoadAnimation(script:WaitForChild("Shove"));
- local readied = false;
- local sitting = false;
- local bowing = false;
- local begging = false;
- local kneeling = false;
- local sleeping = false;
- local shoving = false;
- local busy = false;
- local kg = {
- "Player1";
- "HimaruXx";
- "DrummerDude28";
- "DatDoodRules";
- "Lord_Annatar";
- };
- function checkForTools()
- for i,v in pairs(character:GetChildren()) do
- if v:IsA("Tool") then
- return true;
- end;
- end;
- return false;
- end;
- character.ChildAdded:connect(function(child)
- if child:IsA("Tool") then
- local animsPlaying = h:GetPlayingAnimationTracks();
- for i,v in pairs(animsPlaying) do
- if v.Name ~= "WalkAnim" and v.Name ~= "Hold" and v.Name ~= "Animation1" then
- v:Stop();
- end;
- end;
- readied = false;
- sitting = false;
- bowing = false;
- begging = false;
- kneeling = false;
- sleeping = false
- busy = false;
- if h.WalkSpeed < 16 then
- h.WalkSpeed = 16;
- end;
- end;
- end);
- UIS.InputBegan:connect(function(key, chatting)
- if not chatting and not checkForTools() then
- if key.KeyCode == Enum.KeyCode.R then
- if not busy and not readied then
- busy = true;
- readied = true;
- ready:Play();
- AnimationHandler:FireServer(1);
- elseif busy and readied then
- AnimationHandler:FireServer(2);
- ready:Stop();
- readied = false;
- busy = false;
- end;
- end;
- if key.KeyCode == Enum.KeyCode.X then
- if not busy and not sitting then
- h.WalkSpeed = 0
- busy = true;
- sitting = true;
- sit:Play();
- elseif busy and sitting then
- h.WalkSpeed = 16
- sit:Stop();
- sitting = false;
- busy = false;
- end;
- end;
- if key.KeyCode == Enum.KeyCode.B then
- if not busy and not bowing then
- h.WalkSpeed = 0
- busy = true;
- bowing = true;
- bow:Play();
- elseif busy and bowing then
- h.WalkSpeed = 16
- bow:Stop();
- bowing = false;
- busy = false;
- end;
- end;
- if key.KeyCode == Enum.KeyCode.N then
- if not busy and not begging then
- h.WalkSpeed = 0
- busy = true;
- begging = true;
- beg:Play();
- elseif busy and begging then
- h.WalkSpeed = 16
- beg:Stop();
- begging = false;
- busy = false;
- end;
- end;
- if key.KeyCode == Enum.KeyCode.C then
- if not busy and not kneeling then
- h.WalkSpeed = 0
- busy = true;
- kneeling = true;
- kneel:Play();
- elseif busy and kneeling then
- h.WalkSpeed = 16
- kneel:Stop();
- kneeling = false;
- busy = false;
- end;
- end;
- if key.KeyCode == Enum.KeyCode.V then
- if not busy and not sleeping then
- h.WalkSpeed = 0;
- busy = true;
- sleeping = true;
- sleep:Play()
- elseif busy and sleeping then
- h.WalkSpeed = 16;
- sleep:Stop();
- sleeping = false;
- busy = false;
- end;
- end;
- if key.KeyCode == Enum.KeyCode.Z then
- for i,v in pairs(kg) do
- if v:lower() == player.Name:lower() then
- if not busy and not shoving then
- busy, shoving = true, true;
- shove:Play();
- AnimationHandler:FireServer(3);
- wait(1);
- busy, shoving = false, false;
- end;
- end;
- end;
- end;
- end;
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement