So ive been trying to make a script where when a player presses down the 'F' Key, The player spawns in a part. I have been trying to tell the part to position to the Right Arm in the players model but everytime I call it, it spawns to the center of the map as if I didnt call it to the players Right Arm.
vPlayer = game.Players.LocalPlayer local character = vPlayer.Character local _RightArm = character:FindFirstChild("Right Arm") function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.F and _RightArm then local part = Instance.new('Part') part.Name = 'Crow' part:Clone().Parent = character part.CFrame = _RightArm.CFrame end end game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Im not sure why it isnt detecting the RightArms position, any help would be much appreciated
This may help, But if any of you are familiar with Shinobi Life on roblox, I am basically trying to make it so when you press a key it does an action, in my case its spawning a brick in my hand.
Okay it seems like you aren't familiar with LUA so let me fill you in on some knowledge. You can't just do Part.Position = Right Arm why would you think that'd work.Instead do the following:Use Vector3 or do what is done below;Use CFrame instead(if you choose the first one you suck).
Part.Position = RightArm.Position
Part.CFrame = RightArm.CFrame
UserInputService wont work if it isn't in a localscript. Otherwise, I don't see anything wrong.