Log in to vote

Unable to cast Instance to CoordinateFrame?

Asked by 15 days ago

***`game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) local Case = script.Case:Clone() Case:SetPrimaryPartCFrame(Character.HumanoidRootPart) Case.Parent = Character

  local weld ="ManualWeld")
    weld.Part0 = Case.PrimaryPart
    weld.Part1 = Character.PrimaryPart
    weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
    weld.Parent = weld.Part0
    local Sword = script.Katana:Clone()
    Sword:SetPrimaryPartCFrame(Case.Case.CFrame *,-125,2.65))
    Sword.Parent = Character
    local weld2 ="ManualWeld")
    weld2.Part0 = Sword.PrimaryPart
    weld2.Part1 = Character.PrimaryPart
    weld2.C0 = weld2.Part0.CFrame:ToObjectSpace(weld2.Part1.CFrame)
    weld2.Parent = weld2.Part0

end) end)`***

This is my code and when i hit play and this freaking error ...

Unable to cast Instance to CoordinateFrame

what should i do :_)

1 answer

Log in to vote
Answered by 15 days ago

The error means there is an instance where there should be a CFRAME. Please check your code thoroughly before posting an issue. There is an error with the cases primarypartcframe

ty bro im starting learning lua and im noob :T ArastooYsf86 2 — 15d
NP Arastoo, If you need help You can message me iNi#2338 Kingu_Criminal 111 — 15d

Answer this question