Getting values from tables? again

This time i want to get a position.
this is the script:

local weapon = script.Parent
local enabled = true
local dazed = game.ServerStorage.KatanaDiversity.Dazed2
local rdazed = game.ServerStorage.KatanaDiversity.RevertedDazed
local Char = weapon.Parent.Parent
local RootPart = Char.HumanoidRootPart

local IL = {}

for _,V in pairs(Char:GetDescendants())do
	table.insert(IL, V)
end
print("Check1")

local RAY = Ray.new(RootPart.Position, RootPart.CFrame.LookVector * 100)
local RayPos,HitPos = workspace:FindPartOnRayWithIgnoreList(RAY, IL, false, true)
print("Check2")
local Hits = {}
for index,Items in ipairs(Hits) do
	if not Items then
		print("no items")
	end
	HIt = Items
	print(Items)
end
local part = Instance.new("Part")
part.Anchored = true
if HIt then
	magnitude = (RootPart.Position - HIt.Position).Magnitude
else
	magnitude = 100
end
part.Size = Vector3(1,1, magnitude)

please Help me.

the problem is Workspace.training.C Dummy.Katana.KatanaHitbox.DamageStrikeLdRu:33: attempt to call a table value

(that’s the last row from the script)

in my case magnitude is the length of the part and when i put it in vector 3 it says that it’s a table value

Thanks,
Tem

More information, please:

  1. What do you want to achieve? Keep it simple and clear!

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

made some changes, hopefully it explains better

1 Like

You forgot to put Vector3.new

You put Vector3 instead

image

oops, thanks

(30__ characters)