I've made a box that spawns infront of the player and damages any other players, however instead of damaging players I just get this error: "TakeDamage is not a valid member of Model"
local HB = game.ServerStorage.HB1:WaitForChild("H1")
local Character = player.Character
local Hitb = HB:Clone()
Hitb.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-5)
Hitb.Parent = workspace
Touch = Hitb.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name ~= player.Name then
hit.Parent:TakeDamage(15)
if Touch ~= nil then Touch:Disconnect() end
Hitb:Destroy()
end
end
end)

2 comments
It might be because you're doing hit.Parent:TakeDamage(15), and what it looks like, that is refering to the Character, not the players humanoid. I could be wrong.
I'd also like to recommend you use FindFirstChildOfClass("Humanoid") just to make sure that what you are trying to damage is, in fact, a Humanoid