This script damages any player that is hit by it, but if the player with the weapons stays still it instead passes through them without doing any damage...
local modelstuff = {}
function ontouch(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local model = hit.Parent
local hum = hit.Parent:FindFirstChild("Humanoid")
if modelstuff[model] then
return
else
local def = hit.Parent:FindFirstChild("Defense").Value
local dmg = script.Parent.Parent:WaitForChild("Attack").Value - def
hum:TakeDamage(dmg)
if hit.Parent:FindFirstChild("Bleed") then
if hit.Parent:FindFirstChild("Streak") then
else
local streak = Instance.new("IntValue")
streak.Parent = hit.Parent
streak.Name = "Streak"
end
local st = hit.Parent:FindFirstChild("Streak")
st.Value = st.Value + 1
hit.Parent:FindFirstChild("Bleed").Dmg.Value = hit.Parent:FindFirstChild("Bleed").Dmg.Value + 1
hit.Parent:FindFirstChild("Bleed").Time.Value = hit.Parent:FindFirstChild("Bleed").Time.Value + 1
local bled = hit.Parent:FindFirstChild("Head").Bleed
bled.TextLabel.Text = "Bleed X".. st.Value
else
local bleed = game.ServerStorage.Effects.Bleed:Clone()
bleed.Disabled = false
bleed.Parent = hit.Parent
end
local h = hit.Parent:FindFirstChild("HumanoidRootPart")
local bb = game.ServerStorage.Classes.BillboardGui:Clone()
bb.Parent = h
local txtlabel = bb:WaitForChild("TextBox")
if dmg > 20 then
txtlabel.TextColor3 = Color3.fromRGB(255,0,0)
end
txtlabel.Text = tostring(dmg)
end
modelstuff[model] = true
wait(.5)
modelstuff[model] = false
end
end
script.Parent.DmgBox.Touched:Connect(ontouch)
Please help me, i cant script

8 comments
You can't script? How did you make this?
I can't script well...
I remember having the same problem when making a gun. Idk how ur weapons work, so you should make a script that checks whether hit.Parent is a weapon
I don't get it, what do you mean? What would making a script that checks if hit.Parent is a weapon do?
models hit, the table of characters hit
oh ok. i thought you said a bad word
I went ahead and changed the variable name anyway since it did seem like vulgar words. Might I suggest using camel case in the future?
Ok, yea sorry i should've changed it