Im trying to make a laser pistol, but im having issues with cframe.angles.
https://gyazo.com/3c9078cdf9bd87cedd0ee08780df669b
local c = nil
local fireeve = script.Parent:WaitForChild("Fire")
fireeve.OnServerEvent:Connect(function(p,mousePos)
c = p.Character
local b = game.ReplicatedStorage.Beam:Clone()
b.Parent = workspace
b.Script.Ignore.Value = c.Name
b.CFrame = CFrame.new(script.Parent.FirePart.Position) * CFrame.Angles(math.rad(0),math.rad(script.Parent.FirePart.Orientation.Y),math.rad(0))
b.Velocity = mousePos.LookVector * 500
script.Shot:Play()
end)
fireeve is a remote event inside of the tool
Parent of this script is a tool
The event was fired from a simple tool,Activated script, with Mouse.Hit in the parentheses (aka mousePos)
There were no errors
CFrame.new part works just fine but the cframe.angles part is where it doesnt work
I dont know if you can use a parts orientation as a value in cframe, but i dont know of any other method.