Tool's name is "Excalibur", parent "Workspace".
But how to put that in script? I tried local Tool = script.Parent.Workspace and local Tool = Excalibur and many other things, but nothing worked. (my scripting skills are almost zero)
-- R attack
local Tool = -- here
local Player = game.Players.LocalPlayer
local Character = Player.Character or script.Parent
local Humanoid = Character.Humanoid
local UserInputService = game:GetService("UserInputService")
local AnimationID = 'rbxassetid://4868889544'
local Animation = Instance.new("Animation")
Animation.AnimationId = AnimationID
local LoadAnimation = Humanoid:LoadAnimation(Animation)
local key = 'R'
local debounce = true
Tool.Equipped:Connect(function()
UserInputService.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
if Input.KeyCode == Enum.KeyCode[key] and debounce == true then
debounce = false
LoadAnimation:Play()
wait(5)
debounce = true
end
end)
end)
Tool.Unequipped:Connect(function()
LoadAnimation:Stop()
end)
