Oh, forgot the script here it is.
(By the way I'm not close to finished with this script however, if you have any tips to using UIS let me know.)
vital = {v = "UpperTorso","LowerTorso","Head"}
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character ~= nil and Player:HasAppearanceLoaded() == true and script:FindFirstChild("Animation")~=nil
local char = Player.Character
local Mouse = Player:GetMouse()
local Animations = {script.Animation}
enabled = false
local function find(x,y)
for i,v in pairs(y) do
if v == x then
return true
end
end
return false
end
function onKeyPress(inputObject, gameProcessedEvent)
if enabled then return elseif inputObject.KeyCode == Enum.KeyCode.E then
print("fires")
coroutine.wrap(function()
local animtrack = char.Humanoid:LoadAnimation(Animations[1])
animtrack:Play()
print('test')
wait(5)
enabled = false
end)()
local RArm = char:WaitForChild("RightHand")
RArm.Touched:connect(function(hit)
if enabled and hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("Hitby"..char.Name) == nil then
local hitty = Instance.new("BoolValue",hit.Parent)
hitty.Name = "Hitby"..char.Name
game.Debris:AddItem(hitty,1)
print("works")
if find(hit.Name,vital) then
hit.Parent.Humanoid:TakeDamage(20)
else
hit.Parent.Humanoid:TakeDamage(5)
end
end
end)
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress) |