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

what is this error?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
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

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

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.

Ad

Answer this question