Iwjdnned
Iwjdnned
Mimicking
local Players = game:GetService("Players")
local PathfindingService = game:GetService("PathfindingService")
local RunService = game:GetService("RunService")
local StarterGui = game:GetService("StarterGui")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
-- Create R6 rig
local humanoid = Instance.new("Humanoid")
humanoid.Parent = entity
humanoid.WalkSpeed = 16 -- Match player speed
humanoid.JumpPower = 50 -- Match player jump
humanoid.HipHeight = 2 -- Standard R6 height
humanoid.AutoRotate = true -- Face movement direction
-- Weld parts
local function weld(part1, part2, c0)
local weld = Instance.new("Weld")
weld.Part0 = part1
weld.Part1 = part2
weld.C0 = c0
weld.Parent = part1
end
humanoid.Jumping:Connect(function()
playAnimation(animations.jump)
end)
humanoid.Climbing:Connect(function()
playAnimation(animations.climb)
end)
]]
animateScript.Parent = entity
entity.Parent = game.Workspace
return entity, humanoid, rootPart
end
-- Create path
local path = PathfindingService:CreatePath({
AgentRadius = 2,
AgentHeight = 5,
AgentCanJump = true,
Costs = {
Water = 20,
Unwalkable = math.huge
}
})
-- Handle jumps
if waypoint.Action == Enum.PathWaypointAction.Jump then
entityHumanoid.Jump = true
end
-- Wait until reaching waypoint or timeout
local reached = false
local timeout = tick() + 2 -- 2-second timeout
while tick() < timeout and not reached do
if (entityRootPart.Position - waypoint.Position).Magnitude < 1 then
reached = true
end
RunService.Heartbeat:Wait()
end
end
else
-- Fallback: Move directly if pathfinding fails
entityHumanoid:MoveTo(targetPos)
end
end
-- Match jump
if playerHumanoid.Jump then
entityHumanoid.Jump = true
end
-- Match climbing
if playerHumanoid:GetState() == Enum.HumanoidStateType.Climbing then
entityHumanoid:ChangeState(Enum.HumanoidStateType.Climbing)
end
end