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

Rotating a model by keypress?

game["Run Service"].RenderStepped:connect(function()
	if Mouse.target then
		CloneFrom.Model:SetPrimaryPartCFrame(CFrame.new(math.floor(Mouse.hit.p.X),math.floor(game.Lighting[script.Parent.Parent.PlayerGui.Gui.Insert.Value].Model.Primary.Position.Y),math.floor(Mouse.hit.p.Z)))
	end
end)

Mouse.KeyDown:connect(function(key)
	if key == "r" then
		local model = CloneFrom.Model
		model.PrimaryPart = model.Primary
		model:SetPrimaryPartCFrame()
	end
end)

Above is my current code.

I've tried different ways for the SetPrimaryPartCFrame() rotation but I can't seem to make it work

Any help?

1 answer

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