so basically whenever i try to move this crab model with tweenservice, it just doesnt work, saying Position is not a valid member of Model, and if i move the hitbox, it only moves the hitbox.
besides the beautiful art of the crab, whats the issue with this
(also you prolly dont have to read through this anyways)
local ts = game:GetService("TweenService")
local runService = game:GetService("RunService")
local db = false
local crab = script.Parent
local function move()
if db == true then
return
end
local players = game.Players:GetPlayers()
local count = 0
local allPos = {}
for _, v in pairs(game.Players:GetChildren()) do
count += 1
local plrModel = game.Workspace:FindFirstChild(tostring(players[count]))
local posPlr = plrModel.HumanoidRootPart.Position
local mag = (posPlr - crab.Position).Magnitude
table.insert(allPos, mag)
end
local curLowest = 0
local count = 0
local lowPos = 0
for _, v in allPos do
count += 1
if curLowest ~= 0 then
if v < curLowest then
curLowest = v
lowPos = count
end
else
curLowest = v
lowPos = count
end
end
local target = game.Workspace:FindFirstChild(tostring(players[lowPos])) --
local speed = 50
local mag = curLowest
local t = mag / speed
local endPos = {Position = target.HumanoidRootPart.Position}
local moveTween = ts:Create(crab, TweenInfo.new(t, Enum.EasingStyle.Linear), endPos)
moveTween:Play()
wait(0.5)
end
runService.Heartbeat:Connect(move)
what i suggest you do instead is tween the crab's primaryparts' cframe (model.PrimaryPart). set the primarypart to something similar to humanoidrootpart
** You are now Level 5! **