so i'm making a sword;
script.Parent.Handle.Touched:Connect(function(p)
if script.Parent.CanDamage.Value == true then
script.Parent.CanDamage.Value = false
local AttackDamage = math.random(script.Parent.MinAttackDamage.Value,script.Parent.MaxAttackDamage.Value)
local Victim = p.Parent:FindFirstChild("Humanoid")
if Victim == nil then
return p
else
Victim:TakeDamage(AttackDamage)
local DamageText = Instance.new("TextLabel",p.Parent.Head.DamageGui) -- Displays the damage done to the humanoid
DamageText.Name = "DamageText"
DamageText.Text = AttackDamage
DamageText.Size = UDim2.new(1,0,1,0)
DamageText.BackgroundTransparency = 1
DamageText.TextColor3 = Color3.fromRGB(255,255,255)
DamageText.TextScaled = true
DamageText.TextStrokeTransparency = 0.5
local DamageTextScript = game.ServerStorage.DamageTextScript:Clone() -- Will add the script for removing and deleting the copied DamageText
DamageTextScript.Parent = DamageText
DamageTextScript.Disabled = false
wait(script.Parent.AttackDelay.Value)
script.Parent.CanDamage.Value = true
end
end
end)
i'm not sure how it can change the info stored in the function(p) part because i can't get it o attack other things if the thing it attack doesn't have a humanoid. please help me...

3 comments
I dont understand what you're asking, you want to be able to attack things that dont have a humanoid?
No, he wants to make the sword to only damage an enemy once.
no. i want to be able to attack something that is alive even though what it touched before wasnt. therefore having the script locking on to that thing that wasnt alive previously.