Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Unable to cast Instance to CoordinateFrame?

***`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 = Instance.new("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 * CFrame.new(0,-125,2.65))
  Sword.Parent = Character
  local weld2 = Instance.new("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

✓ Accepted answer

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

Case:SetPrimaryPartCFrame(Character.HumanoidRootPart.CFrame)

2 comments

0

ty bro im starting learning lua and im noob :T

0

NP Arastoo, If you need help You can message me iNi#2338

This discussion is preserved as it was. New answers, comments, and votes are closed.