So i have a sword and in the sword is a script and a local script local words but the server script doesn't I need help heres the code I never scripted a weapon(I scripted a few tools before but not a weapon) so it might be bad
local tool = script.Parent
local char = tool.Parent
local mindmg = 15
local maxdmg = 70
tool.Activated:Connect(function()
tool.blade.Touched:Connect(function(p)
local hitted = game.Players:GetPlayerFromCharacter(p.Parent)
local hitter = game.Players:GetPlayerFromCharacter(char)
if hitted and hitter then
if hitted.TeamColor == hitter.TeamColor then
else
p.Parent.Humanoid:TakeDamage(math.random(mindmg,maxdmg))
end
end
end)
end)

3 comments
is this a local script
Where are you defining him at line 11?
so i had hum but i changed to p for whatever reason sorry