Загрузка данных


local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")

local template = ServerStorage:WaitForChild("StuntModel")

local function spawnScooter(player, character)
    local root = character:WaitForChild("HumanoidRootPart", 10)
    if not root then return end

    task.wait(1)

    local name = "Stunt_" .. player.UserId
    local old = workspace:FindFirstChild(name)
    if old then old:Destroy() end

    local scooter = template:Clone()
    scooter.Name = name

    for _, part in ipairs(scooter:GetDescendants()) do
        if part:IsA("BasePart") then
            part.Anchored = true
            part.CanCollide = false
        end
    end

    local target = root.CFrame * CFrame.new(0, -2, -4)
    scooter:PivotTo(target)
    scooter.Parent = workspace

    -- невидимая площадка под ногами
    local platform = Instance.new("Part")
    platform.Name = "StandingPlatform"
    platform.Size = Vector3.new(3, 0.3, 1.5)
    platform.Transparency = 1
    platform.Anchored = true
    platform.CanCollide = true
    platform.CFrame = target * CFrame.new(0, 0.8, 0)
    platform.Parent = scooter
end

local function setupPlayer(player)
    player.CharacterAdded:Connect(function(character)
        spawnScooter(player, character)
    end)

    if player.Character then
        task.spawn(spawnScooter, player, player.Character)
    end
end

Players.PlayerAdded:Connect(setupPlayer)

for _, player in ipairs(Players:GetPlayers()) do
    setupPlayer(player)
end