local prox = script.Parent
prox.ActionText = prox.Parent.Name
local model = script.Parent.Parent.Parent.Name
local tool = game.ReplicatedStorage["Food // Settings"].Tools:FindFirstChild(model)
prox.Triggered:Connect(function(player)
local backpack = player.Backpack
if player and player.Character and not backpack:FindFirstChild(tool.Name) then
tool:Clone().Parent = backpack
end
end)
script
local SETTINGS = require(game.ReplicatedStorage["Food // Settings"])
local values = {
anim_speed = SETTINGS.Anim_speed;
anim = SETTINGS.Animation;
bool = false;
bool_time = SETTINGS.booltime
}
local plr = game.Players.LocalPlayer; local char = plr.CharacterAdded:Wait() or plr.Character; local hum = char:WaitForChild("Humanoid"); local animationtrack = hum:LoadAnimation(values.anim); animationtrack:AdjustSpeed(values.anim_speed); local uis = game:GetService("UserInputService")
script.Parent.Equipped:Connect(function()
uis.InputBegan:Connect(function(key, gp)
if gp then return end if not char:FindFirstChild(script.Parent.Name) then animationtrack:Stop() return end
if key.UserInputType == Enum.UserInputType.MouseButton1 and not values.bool then
animationtrack:Play()
values.bool = true
wait(values.bool_time)
animationtrack:Stop()
values.bool = false
end
end)
end)
local script