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

My CFraming will not work out as planned... Could someone help?

Asked by 4 years ago

So I am making a door that if you push a button a door will open up. One door will open, but the other one won't. The error I got was " 18:55:09.277 - Workspace.YES.Script:9: attempt to index nil with 'CFrame' "

here's my code:




local door_a = game.Workspace:WaitForChild("DOOR_A") local door_b = game.Workspace:WaitForChild("DOOR_B") local click = script.Parent:WaitForChild("ClickDetector") local example_a = game.Workspace:WaitForChild("EXAMPLE_A") local example_b game.Workspace:WaitForChild("EXAMPLE_B") local ts = game:GetService("TweenService") click.MouseClick:Connect(function(player) ts:Create(door_a,TweenInfo.new(.5,Enum.EasingStyle.Sine),{CFrame = example_a.CFrame}):Play() ts:Create(door_b,TweenInfo.new(.5,Enum.EasingStyle.Sine),{CFrame = example_b.CFrame}):Play() end)
0
The reason it didnt work was because you need to set the position to a vector3 JesseSong 3916 — 4y
0
On line 9 change Cframe to {Position = Vector3.new(0, 30, 0)}) JesseSong 3916 — 4y

Answer this question