Hello, I made a bandage tool it works perfectly, the only thing that doesnt work is the particle beacause it doesnt emit.
Heres my script:
local Animation = game.ReplicatedStorage.Animations.Support.Bandage
local PLR = game.Players.LocalPlayer
local Char = PLR.Character or PLR.CharacterAdded:Wait()
local HUM = Char:WaitForChild("Humanoid")
local Timer = 2.1
local LoadedAnimation = HUM:LoadAnimation(Animation)
local Tool = script.Parent
local Sound = Instance.new("Sound")
Sound.SoundId = "rbxassetid://5020631118"
local UIS = game:GetService("UserInputService")
local Debounce = false
local Healing = 0
Tool.Equipped:Connect(function()
Equipped = true
end)
Tool.Unequipped:Connect(function()
Equipped = false
end)
local Used = false
UIS.InputBegan:Connect(function(Input, GPE)
if GPE or not Equipped then
return
end
if Input.UserInputType == Enum.UserInputType.MouseButton1 and not Debounce then
local Sound = Instance.new("Sound")
local HeartEffectCloned = game.ReplicatedStorage.Particles.Support.EmitHealVFX:Clone()
Used = true
Sound.SoundId = "rbxassetid://5020631118"
Debounce = true
HUM.AutoRotate = false
local Root = Char:WaitForChild("HumanoidRootPart")
LoadedAnimation:Play()
wait(Timer + .3)
Sound:Play()
for i,v in pairs(HeartEffectCloned:GetDescendants()) do
if v:IsA("ParticleEmitter") then
v:Emit(v.Rate)
end
end
HeartEffectCloned.Parent = Char.PrimaryPart
Sound.Parent = Char.PrimaryPart
HUM.Health = HUM.Health + 25
Used = false
print(HUM.Health)
HUM.AutoRotate = true
wait(3)
Sound:Destroy()
--HeartEffectCloned:Destroy()
Debounce = false
end
while Used do
repeat
HUM.WalkSpeed = 6
wait(0.01)
until not Used
HUM.WalkSpeed = 12
end
end)```