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

what is this error?

local enabled = true
Player = script.Parent.Parent
character = Player.CharacterAdded:wait();
mouse = Player:GetMouse()
Run = game:GetService("RunService")
function onKeyDown(key)
	key = key:lower()
	if key == "r" then
		game:GetService("Chat"):Chat(Player.Character.Head, "REN!")
		r = Instance.new("Part")
		r.Shape = "Ball"
		r.Transparency = 0.7
		r.BrickColor = BrickColor.new("White")
		r.CFrame = Player.Character["Torso"] *CFrame.new(0, 0, 0)
		r.Parent = workspace
	end
end

mouse.KeyDown:connect(onKeyDown)

17:15:00.126 - Players.kingalpha1.Backpack.Ren:15: bad argument #1 to '?' (CFrame expected, got userdata)

1 answer

✓ Accepted answer

The line number is off (for whatever reason)

On line 14, you are multiplying a Part (the Torso) by a CFrame, which is an error.


Probably you mean to use Player.Character.Torso.CFrame * CFrame.new(0, 0, 0)


There was no reason to use Character["Torso"] over Character.Torso.

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