it just doesnt works, i try to get the string value but it just returns this error, it works on other games, even with no findfirstchild, but it just doesnt works here, the sword works fine tho
the error is at line 31
script.Parent.OnServerEvent:Connect(function(plr)
if plr.Data.Weapon.Value == "Sword" then
local char = plr.Character
local anim = char:FindFirstChild("Humanoid"):LoadAnimation(script.Swing)
anim:Play()
pcall(function()
char.Sword.Trail.Enabled = true
wait(.3)
char.Sword.Trail.Enabled = false
end)
for i,v in pairs(workspace:GetChildren()) do
if v.Name ~= char.Name then
if v:FindFirstChild("Enemy") then
if (char.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude < 8 then
v.Enemy.Health -= 20
v.LastToHit.Value = char.Name
local sound = script.Sound:Clone()
sound.Parent = char.HumanoidRootPart
sound:Play()
game.Debris:AddItem(sound,1)
end
end
end
end
elseif plr.Data.Weapon.Value == "Bow" then
local char = plr.Character
local anim = char:FindFirstChild("Humanoid"):LoadAnimation(script.Bow)
anim:Play()
local arrow = game.ServerStorage.ArrowF:Clone()
arrow.Parent = workspace
arrow:FindFirstChild("Player").Value = char.Name
arrow.Position = char.HumanoidRootPart.Position
arrow.Orientation = char.HumanoidRootPart.Orientation
local bv = Instance.new("BodyVelocity",arrow)
bv.Velocity = char.HumanoidRootPart.CFrame.LookVector * 40
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
game.Debris:AddItem(arrow,5)
end
end)
please someone help me, if you need more information comment

5 comments
there is a value inside of the arrow
Oh
the arrow is a part not a model
OH IM DUMB, THE VALUE IS INSIDE OF A SCRIPT INSIDE OF THE ARROW... i will just accept this answer
Oh well ok no problem