I'm storing numbers in variables to use them later. But everything works fine until it gets to line 23. Here's the error i got

20:53:26.978 - ReplicatedFirst.BedScript:23: bad argument #3 to 'Angles' (number expected, got no value)

local player = game.Player.LocalPlayer
local char = player.Character
local mouse = Player:GetMouse()
local debounce = false
local cframeS  --position
local cframeE  --position
local cframeSA  --angles
local cframeEA  --angles

 mouse.Button1Down:connect(function()
	if debounce == false then
		debounce = true 
		print(mouse.Target.Name)
		if mouse.Target.Name == "BedPart"then
         local part = game.Workspace.EventParts:FindFirstChild(mouse.Target.Name)
   if part.Value == "Bed1"then
	cframeS = 428.399, 138, 255.3
	cframeSA = 0,185.5,0
   elseif part.Value == "Bed2"then
	cframeS = 428.399, 138, 239.8
	cframeSA = 0,0,0
    end
char.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(cframeS)) * CFrame.Angles(cframeSA)
wait(5)
Debounce = false
  end
 end
end)

7 comments

0

Don't know if this will correlate but maybe your "mouse.Button1Down:connect(function()" and it's contents should be moved one tiny line back like just a press of a backspace for the function and it's contents.

0

No it didn't help but, thanks for trying :D

1

For lines 17-18, and 20-21, that's for possible from what you're trying to accomplish: You have to convert those number into a vector3 value first (I believe).

0

Btw, CFrame.Angles work in radians: To accomplish what you're trying to do, use the math.rad function. :)

0

What do you mean by for possible, and i'll try the math.rad

0

OH WAIT, lol i defined the variables wrong... oops

0

If you have figured out the problem, be sure to edit the title to include something like "[Solved]"