Thank you for reading please help fix this
local debounce = false
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local character = player.Character or player.CharacterAdded:Wait()
local animInstance = Instance.new("Animation")
local humanoid = character:WaitForChild("Humanoid")
animInstance.AnimationId = "rbxassetid://6380434675"
local anim = humanoid:LoadAnimation(animInstance)
local Col = game:GetService("CollectionService")
local tag = Col:GetTagged("Rain")
local torso = game.Workspace:FindFirstChild(player.Name)
mouse.KeyDown:connect(function(key)
if key == "e" then
if not debounce then
torso.UpperTorso.Anchored = true
anim:Play()
local n = 10
for i = 1, n do
wait(0.5)
torso.UpperTorso.Anchored = false
for _, TaggedPart in pairs(tag) do
local part = TaggedPart:Clone()
part.Parent = game.Workspace
part.Position = torso.UpperTorso.Position +(torso.UpperTorso.CFrame.lookVector*20) + Vector3.new(0,50,0)
if part.Touched:Connect(function(hit)
local player = game.Players.LocalPlayer
local humanoid = game.Workspace:FindFirstChild(player.Name).Humanoid
humanoid.Health = humanoid.Health - 30
end
end
end
end
end
end
end)

3 comments
All my homies hate mouse
I hope you were referring to KeyDown instead of the mouse itself lul
KeyDown is deprecated, use UserInputService.