alright. ill send both source codes.
NEW kit – really long
local UIS = game:GetService("UserInputService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local hmr = character:WaitForChild("HumanoidRootPart")
local gui = player.PlayerGui.FnfGui
local camera = workspace.CurrentCamera
local LocalFolder = game:GetService("ReplicatedStorage").Local
local keybinding = require(LocalFolder.Keybinding)
local keybindsFolder = LocalFolder.Keybinds
local newKeybind = keybinding.new(keybindsFolder)
local mic = script.Parent
local micEquipped = false
local animationTrack
local animationObject = Instance.new("Animation")
animationObject.Name = "NormalAnimation"
animationObject.Parent = mic
local idle = "rbxassetid://" .. mic:GetAttribute("IdleAnimation")
function getInputDir(keyCode)
return newKeybind.get(keyCode)
end
local playAnim = {}
function playAnimation(id)
playAnim[id] = true
animationObject.AnimationId = id
if animationTrack ~= nil then
if animationTrack.IsPlaying and animationTrack.Animation.AnimationId ~= id then
animationTrack:Disconnect()
end
end
animationTrack = humanoid.Animator:LoadAnimation(animationObject)
animationTrack:Play(0)
local onStop
onStop = animationTrack.Stopped:Connect(function()
playAnim[id] = false
onStop:Stop()
end)
end
local highlightedImg = {}
function highlightImage(image,state)
if not highlightedImg[image.Name] then
local arrowColors = {
UpArrow = Color3.fromRGB(0,255,0),
LeftArrow = Color3.fromRGB(255,0,255),
DownArrow = Color3.fromRGB(0,64,255),
RightArrow = Color3.fromRGB(255,0,0),
}
highlightedImg[image.Name] = true
if state == nil then
spawn(function()
local tweenIn = game:GetService("TweenService"):Create(image, TweenInfo.new(0.05), {ImageColor3 = Color3.fromRGB(255,255,255),ImageTransparency = 0})
tweenIn:Play()
tweenIn.Completed:Wait()
local tweenOut = game:GetService("TweenService"):Create(image, TweenInfo.new(0.05), {ImageColor3 = Color3.fromRGB(100,100,100),ImageTransparency = 1})
tweenOut:Play()
tweenOut.Completed:Wait(0.7)
highlightedImg[image.Name] = false
end)
elseif state == "In" then
spawn(function()
local tweenIn = game:GetService("TweenService"):Create(image, TweenInfo.new(0.05), {ImageColor3 = Color3.fromRGB(255,255,255),ImageTransparency = 0})
tweenIn:Play()
tweenIn.Completed:Wait(0.7)
end)
elseif state == "Out" then
spawn(function()
local tweenOut = game:GetService("TweenService"):Create(image, TweenInfo.new(0.05), {ImageColor3 = Color3.fromRGB(100,100,100),ImageTransparency = 1})
tweenOut:Play()
tweenOut.Completed:Wait(0.7)
highlightedImg[image.Name] = false
end)
end
end
if state == "Out" and highlightedImg[image.Name] then
spawn(function()
local tweenOut = game:GetService("TweenService"):Create(image, TweenInfo.new(0.05), {ImageColor3 = Color3.fromRGB(100,100,100),ImageTransparency = 1})
tweenOut:Play()
tweenOut.Completed:Wait(0.7)
highlightedImg[image.Name] = false
end)
end
end
mic.Equipped:Connect(function()
micEquipped = true
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
playAnimation(idle)
gui.Enabled = true
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = hmr.CFrame + hmr.CFrame.RightVector * 13
camera.CFrame = CFrame.lookAt(camera.CFrame.Position, hmr.Position)
if gui.Enabled == false then
gui.Enabled = true
end
end)
mic.Unequipped:Connect(function()
if humanoid:FindFirstChild("Animator") ~= nil then
for _i,aTrack in pairs(humanoid.Animator:GetPlayingAnimationTracks()) do
aTrack:Stop()
end
end
micEquipped = false
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
local activeTracks = humanoid:GetPlayingAnimationTracks()
for _,v in pairs(activeTracks) do
v:Stop()
end
gui.Enabled = false
camera.CameraType = Enum.CameraType.Custom
if gui.Enabled == true then
gui.Enabled = false
end
end)
local direction
local allKeysHeld = {}
local isKeyHoldRunning = false
local function keyHold()
if not isKeyHoldRunning then
isKeyHoldRunning = true
local validKeys = newKeybind.getKeys()
local function validKeyPressed()
local status = false
for key,action in pairs(validKeys) do
if allKeysHeld[Enum.KeyCode[key]] then
status = true
break
end
end
return status
end
local function playLoopedAnimation()
for key,action in pairs(validKeys) do
if allKeysHeld[Enum.KeyCode[key]] then
direction = getInputDir(Enum.KeyCode[key])
if direction ~= nil and direction ~= "No key!" then
playAnimation("rbxassetid://" .. mic:GetAttribute(direction .. "Animation"))
end
end
end
end
local function highlightHeldArrow()
for key,action in pairs(validKeys) do
if allKeysHeld[Enum.KeyCode[key]] then
highlightImage(gui.GlowArrows:FindFirstChild(action .. "Arrow"),"In")
else
highlightImage(gui.GlowArrows:FindFirstChild(action .. "Arrow"),"Out")
end
end
end
while validKeyPressed() do
task.wait()
highlightHeldArrow()
playLoopedAnimation()
end
highlightHeldArrow()
isKeyHoldRunning = false
end
end
local mobileIsRunning = {}
local function mobileSupport(arrow,state,input,click)
if micEquipped then
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
if not mobileIsRunning[arrow.Name] and state == "In" then
mobileIsRunning[arrow.Name] = true
direction = string.gsub(arrow.Name,"Arrow","")
local key = newKeybind.getKeyFromAction(direction)
allKeysHeld[Enum.KeyCode[key]] = true
keyHold()
if direction ~= nil and direction ~= "No key!" then
playAnimation("rbxassetid://" .. mic:GetAttribute(direction .. "Animation"))
highlightImage(gui.GlowArrows:FindFirstChild(direction .. "Arrow"))
end
end
end
end
if mobileIsRunning[arrow.Name] and state == "Out" then
direction = string.gsub(arrow.Name,"Arrow","")
local key = newKeybind.getKeyFromAction(direction)
allKeysHeld[Enum.KeyCode[key]] = false
mobileIsRunning[arrow.Name] = false
end
end
UIS.InputBegan:Connect(function(input)
if micEquipped then
if (input.UserInputType == Enum.UserInputType.Keyboard) then
direction = getInputDir(input.KeyCode)
allKeysHeld[input.KeyCode] = true
keyHold()
if direction ~= nil and direction ~= "No key!" then
playAnimation("rbxassetid://" .. mic:GetAttribute(direction .. "Animation"))
highlightImage(gui.GlowArrows:FindFirstChild(direction .. "Arrow"))
end
end
end
end)
UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
allKeysHeld[input.KeyCode] = false
end
if animationTrack ~= nil then
if animationTrack.IsPlaying then
local onStop
onStop = animationTrack.Stopped:Connect(function()
onStop:Disconnect()
end)
end
end
end)
local arrowHitboxUpEvents = {}
local arrowHitboxDownEvents = {}
for _i,arrowHitbox in pairs(gui.MobileArrows:GetChildren()) do
arrowHitboxDownEvents[_i] = arrowHitbox.InputBegan:Connect(function(input,click)
mobileSupport(arrowHitbox,"In",input,click)
end)
arrowHitboxUpEvents[_i] = arrowHitbox.InputEnded:Connect(function(input,click)
mobileSupport(arrowHitbox,"Out",input,click)
end)
end
old kit
local UIS = game:GetService("UserInputService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local hmr = character:WaitForChild("HumanoidRootPart")
local gui = player.PlayerGui.FnfGui
local camera = workspace.CurrentCamera
local LocalFolder = game:GetService("ReplicatedStorage").Local
local keybinding = require(LocalFolder.Keybinding)
local keybindsFolder = LocalFolder.Keybinds
local newKeybind = keybinding.new(keybindsFolder)
local mic = script.Parent
local micEquipped = false
local animationTrack
local animationObject = Instance.new("Animation")
animationObject.Parent = mic
local idle = "rbxassetid://" .. mic:GetAttribute("IdleAnimation")
function getInputDir(keyCode)
return newKeybind.get(keyCode)
end
function playAnimation(id)
animationObject.AnimationId = id
animationTrack = humanoid.Animator:LoadAnimation(animationObject)
animationTrack:Play(0)
end
function highlightImage(image)
spawn(function()
local tweenIn = game:GetService("TweenService"):Create(image, TweenInfo.new(0.1), {ImageColor3 = Color3.fromRGB(255,255,255)})
tweenIn:Play()
tweenIn.Completed:Wait()
local tweenOut = game:GetService("TweenService"):Create(image, TweenInfo.new(0.1), {ImageColor3 = Color3.fromRGB(100,100,100)})
tweenOut:Play()
end)
end
mic.Equipped:Connect(function()
micEquipped = true
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
playAnimation(idle)
gui.Enabled = true
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = hmr.CFrame + hmr.CFrame.RightVector * 13
camera.CFrame = CFrame.lookAt(camera.CFrame.Position, hmr.Position)
end)
mic.Unequipped:Connect(function()
micEquipped = false
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
local activeTracks = humanoid:GetPlayingAnimationTracks()
for _,v in pairs(activeTracks) do
v:Stop()
end
gui.Enabled = false
camera.CameraType = Enum.CameraType.Custom
end)
UIS.InputBegan:Connect(function(input)
if micEquipped and
(input.UserInputType == Enum.UserInputType.Keyboard) then
local direction = getInputDir(input.KeyCode)
print(direction)
if direction ~= nil then
playAnimation("rbxassetid://" .. mic:GetAttribute(direction .. "Animation"))
highlightImage(gui.Arrows:FindFirstChild(direction .. "Arrow"))
end
end
end)