Im creating a tool without using roblox’s premade tool thing. I want to make it so when you right click it plays a aiming down sights animation.
local player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local character = player:WaitForChild("Character")
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://4526383308"
local track = character.Humanoid:LoadAnimation(Anim)
UserInputService.InputBegan:Connect(function(InputObject)
if InputObject.UserInputType == Enum.UserInputType.MouseButton2 then
Anim:Play()
end
end)
I’ve looked all over the forum, all i could find were animations played on tools.
I’m just trying to create a functional pseudo tool.