i have a script where it deals 25 damage
when i use it again it deals 50 damage??!?
pls help
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local selected = false
local selectednpc = nil
local currentnpc = nil
function leftClick()
if selected == false then
script.Parent.Text = (“Who do you wanna attack bro?”)
selected = true
end
if selected == true then
mouse.Button1Down:Connect(function()
if mouse.Target.Parent.Name == (“badguy”) then
currentnpc = mouse.Target.Parent
selectednpc = mouse.Target.Parent.Humanoid
player.Character.Humanoid:MoveTo(mouse.Target.Parent.HumanoidRootPart.Position)
wait(2)
local Attack = player.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Animations.Attack)
Attack:Play()
wait(0.6)
local damagedui = game.ReplicatedStorage.damage1:Clone()
damagedui.Parent = currentnpc.Head
selectednpc:TakeDamage(25)
wait(1)
currentnpc = nil
selectednpc = nil
player.Character.Humanoid:MoveTo(game.Workspace.battleset.battlepos.Position)
wait(1.9)
script.Parent.Text = (“attack”)
selected = false
end
end)
end
end
script.Parent.MouseButton1Click:Connect(leftClick)