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

I have run into an error with a script I'm using (CFrame) can I please have some help on this?

Asked by 5 years ago
Edited 5 years ago

When I enter the test server for my game the part of the script where I get errors is at line 363,

RLWF:Destroy() LLWF:Destroy()

Once in game the server tells me the error and says "Destroy is not a valid member of CFrame" what way is there to fix this?

function DestroyLegWelds()
RLC = New("Motor6D",chara.Torso,"Right Hip",{Part0 = chara.Torso,Part1 = chara["Right Leg"],C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),})
LLC = New("Motor6D",chara.Torso,"Left Hip",{Part0 = chara.Torso,Part1 = chara["Left Leg"],C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),})
RLWF:Destroy()
LLWF:Destroy()
end
RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
RLW.Part0 = chara["Right Leg"]
RLW.C0 = RLWF
LLW = Instance.new("Weld",chara["Left Leg"])
LLW.Part1 = HC.Parent
LLW.Part0 = chara["Left Leg"]
LLW.C0 = LLWF
0
Do you have FE on? RainbowBeastYT 85 — 5y
0
Try using ``Remove()`` RainbowBeastYT 85 — 5y
0
code?? User#17685 0 — 5y

1 answer

Log in to vote
0
Answered by
chomboghai 2044 Moderation Voter Community Moderator
5 years ago

You did not provide code to look at and specifically answer your question, but the problem you're having is this:

You are trying to delete the part's CFrame rather than the part itself.

local part = workspace:WaitForChild("Part")
local partCFrame = part.CFrame

-- you are deleting the cframe
partCFrame:Destroy() -- INCORRECT

-- but you should be deleting the actual part
part:Destroy() -- CORRECT

The above script shows the general error you are making. RWLF is a CFrame data type and you need to instead use :Destroy() on whatever part it is the CFrame for.

Hope this helps :)

0
chom I'm still receiving the same error, but since you ask for a code I give you it. Hope this will help show my problem.                                                                                             function DestroyLegWelds() RLC = New("Motor6D",chara.Torso,"Right Hip",{Part0 = chara.Torso,Part1 = chara["Right Leg"],C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),C1 = CFrame. chad_universal 4 — 5y
0
I cannot read your code like this, please edit your original post and add your code. Make sure to format it properly using the blue Lua button. chomboghai 2044 — 5y
0
edited chad_universal 4 — 5y
0
Can you show more of the script? You never define RLWF and LLWF anywhere in the script you've given. chomboghai 2044 — 5y
View all comments (6 more)
0
does this help? chad_universal 4 — 5y
0
No. Show me where you define RLWF and LLWF. chomboghai 2044 — 5y
0
these to? If not could you show me an example? chad_universal 4 — 5y
0
change RLWF:Destroy() and LLWF:Destroy() to RLW:Destroy() and LLW:Destroy() chomboghai 2044 — 5y
0
change RLWF:Destroy() and LLWF:Destroy() to RLW:Destroy() and LLW:Destroy() chomboghai 2044 — 5y
0
thanks! it works now :)! chad_universal 4 — 5y
Ad

Answer this question