Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GetPrimaryPartCFrame is not a valid member of MeshPart?

Asked by 2 years ago
Edited 2 years ago

I have a script that tweens a mesh (big cat aka bert) however I get an error "GetPrimaryPartCFrame is not a valid member of MeshPart "ReplicatedStorage.bigcat", is there any way I could solve this? How do you tween a mesh? (Yes I know Message is deprecated I only put it there as a placeholder)

local RStorage = game:GetService("ReplicatedStorage")

local SummonBert = RStorage:WaitForChild("SummonBert",math.huge)

local bert = RStorage:FindFirstChild("bigcat")

local tweenService = game:GetService("TweenService")

local Destination = workspace.Destination

local function tweenModel(model, CF)
    local info = TweenInfo.new()
    local CFrameValue = Instance.new("CFrameValue")
    CFrameValue.Value = model:GetPrimaryPartCFrame()

    CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
        model:SetPrimaryPartCFrame(CFrameValue.Value)
    end)

    local tween = tweenService:Create(CFrameValue, info, {Value = CF})
    tween:Play()

    tween.Completed:Connect(function()
        CFrameValue:Destroy()
        for i,v in pairs(game:GetService("Players"):GetPlayers()) do
            wait(3)
            v:Kick("Nothing remains in this world")
        end
    end)
end

SummonBert.OnServerEvent:Connect(function(player)
    bert:Clone().Parent = workspace
    print("Bert has entered workspace")
    wait(3)
    local msg = Instance.new("Message",workspace)
    msg.Text = "Bert has been summoned, the world is doomed"
    msg:Destroy()
    tweenModel(bert,Destination)

    print("OUR LORD AND SAVIOR, BERT HAS BEEN SUMMONED, ALL HAIL BERT")
end)
0
local bert = RStorage:FindFirstChild("bigcat") is bigcat a meshpart or model BulletproofVast 1033 — 2y
0
tween it like a part, not a model greatneil80 2647 — 2y
0
@BulletproofVast its a mesh Velocityok 36 — 2y
0
@greatneil80 kk, il try that! Velocityok 36 — 2y
0
You cant get primarypartcframe of a mesh cos primary part is only on models i think. just do bert.CFrame not bert:Getprimarypartcframe BulletproofVast 1033 — 2y

Answer this question